#include <oscevent.h>
Public Types | |
using | ArgumentConstIterator = utility::UniquePtrConstVectorWrapper< OSCArgumentList, OSCArgument * > |
Public Member Functions | |
OSCEvent ()=delete | |
OSCEvent (const std::string &address) | |
OSCEvent (const std::string &&address) | |
const std::string & | getAddress () const |
template<typename T , typename... Args> | |
OSCArgument * | addArgument (Args &&... args) |
template<typename T , typename... Args> | |
OSCArgument * | addValue (Args &&... args) |
OSCArgument * | addString (const std::string &string) |
int | getCount () const |
const ArgumentConstIterator | getArguments () const |
const OSCArgument * | getArgument (int index) const |
OSCArgument * | getArgument (int index) |
std::size_t | getSize () const |
OSCArgument & | operator[] (std::size_t idx) |
const OSCArgument & | operator[] (std::size_t idx) const |
![]() | |
virtual | ~Event ()=default |
Event ()=default | |
Event (const Event &)=delete | |
Event & | operator= (const Event &)=delete |
Represents a generic OSC event. An OSC event has an address and a set of arguments (values) associated with it. This event can be constructed by a client to be send over or evaluated when received. When constructing this event, the given address must start with a '/' character! Use the array [] overload to access the individual osc arguments.
|
delete |
OSCEvent | ( | const std::string & | address | ) |
OSCEvent constructor
address | the address associated with this osc event |
OSCEvent | ( | const std::string && | address | ) |
OSCEvent constructor
address | the address associated with this osc event |
OSCArgument * addArgument | ( | Args &&... | args | ) |
Adds an OSCArgument to this event. The template type must be of type OSCBaseValue. The arguments are used to construct the OSCValue, for example:
addArgument<OSCFloat>(1.0f) addArgument<OSCString>("ola!")
args | the arguments that are used for constructing the specified OSCValue. |
OSCArgument* addString | ( | const std::string & | string | ) |
Adds an OSCArgument that holds a string. This is a utility function that wraps addArgument
string | the string to give to the argument |
OSCArgument * addValue | ( | Args &&... | args | ) |
Adds an OSCArgument to this event. The argument wraps an OSCValue of type T, for example:
addValue<float>(1.0f) -> adds an OSCValue<float> addValue<int>(1) -> adds an OSCValue<int>.
This is a utility function that wraps addArgument based on the given OSC value type. Note that only registered OSC value types are considered valid.
args | the value that is used to construct the OSCValue. |
const std::string& getAddress | ( | ) | const |
OSCArgument* getArgument | ( | int | index | ) |
index | the index of the argument |
const OSCArgument* getArgument | ( | int | index | ) | const |
index | the index of the argument, will throw an exception when out of bounds |
const ArgumentConstIterator getArguments | ( | ) | const |
int getCount | ( | ) | const |
std::size_t getSize | ( | ) | const |
OSCArgument& operator[] | ( | std::size_t | idx | ) |
Array [] subscript operator
const OSCArgument& operator[] | ( | std::size_t | idx | ) | const |
Array [] subscript operator