LMMS
Loading...
Searching...
No Matches
juce_UMPackets.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23#ifndef DOXYGEN
24
25namespace juce
26{
28{
29
42{
43public:
51 void add (const View& v) { storage.insert (storage.end(), v.cbegin(), v.cend()); }
52
53 void add (const PacketX1& p) { addImpl (p); }
54 void add (const PacketX2& p) { addImpl (p); }
55 void add (const PacketX3& p) { addImpl (p); }
56 void add (const PacketX4& p) { addImpl (p); }
57
59 void reserve (size_t numWords) { storage.reserve (numWords); }
60
62 void clear() { storage.clear(); }
63
67
69 Iterator cend() const noexcept { return Iterator (data() + size(), 0); }
70 Iterator end() const noexcept { return cend(); }
71
73 const uint32_t* data() const noexcept { return storage.data(); }
74
80 size_t size() const noexcept { return storage.size(); }
81
82private:
83 template <size_t numWords>
85 {
87 add (View (p.data()));
88 }
89
90 std::vector<uint32_t> storage;
91};
92
93}
94}
95
96#endif
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_UMPIterator.h:40
Definition juce_UMPacket.h:37
Definition juce_UMPackets.h:42
const uint32_t * data() const noexcept
Definition juce_UMPackets.h:73
void add(const PacketX2 &p)
Definition juce_UMPackets.h:54
Iterator begin() const noexcept
Definition juce_UMPackets.h:66
void add(const PacketX4 &p)
Definition juce_UMPackets.h:56
void add(const View &v)
Definition juce_UMPackets.h:51
size_t size() const noexcept
Definition juce_UMPackets.h:80
std::vector< uint32_t > storage
Definition juce_UMPackets.h:90
void add(const PacketX1 &p)
Definition juce_UMPackets.h:53
void reserve(size_t numWords)
Definition juce_UMPackets.h:59
void add(const PacketX3 &p)
Definition juce_UMPackets.h:55
Iterator cbegin() const noexcept
Definition juce_UMPackets.h:65
Iterator end() const noexcept
Definition juce_UMPackets.h:70
void addImpl(const Packet< numWords > &p)
Definition juce_UMPackets.h:84
void clear()
Definition juce_UMPackets.h:62
Iterator cend() const noexcept
Definition juce_UMPackets.h:69
Definition juce_UMPView.h:46
unsigned v[N_MAX]
Definition inflate.c:1584
JSAMPIMAGE data
Definition jpeglib.h:945
#define jassert(expression)
unsigned int uint32_t
Definition mid.cpp:100
Definition juce_UMP_test.cpp:26
Packet< 4 > PacketX4
Definition juce_UMPacket.h:188
Packet< 3 > PacketX3
Definition juce_UMPacket.h:187
Packet< 1 > PacketX1
Definition juce_UMPacket.h:185
Packet< 2 > PacketX2
Definition juce_UMPacket.h:186
Definition carla_juce.cpp:31
static uint32_t getNumWordsForMessageType(uint32_t)
Definition juce_UMPUtils.cpp:28
uch * p
Definition crypt.c:594
ulg size
Definition extract.c:2350
#define const
Definition zconf.h:137