NAP
Public Member Functions | List of all members
OSCArgument Class Referencefinal

#include <oscargument.h>

Public Member Functions

 OSCArgument ()=default
 
 OSCArgument (OSCValuePtr value)
 
 ~OSCArgument ()=default
 
template<typename T >
const T * get () const
 
template<typename T >
T * get ()
 
rtti::TypeInfo getValueType () const
 
float asFloat () const
 
bool isFloat () const
 
int asInt () const
 
bool isInt () const
 
bool asBool () const
 
bool isBool () const
 
const std::string & asString () const
 
bool isString () const
 
double asDouble () const
 
bool isDouble () const
 
char asChar () const
 
bool isChar () const
 
bool isNil () const
 
std::string toString ()
 
 OSCArgument (OSCArgument &)=delete
 
OSCArgumentoperator= (const OSCArgument &)=delete
 
void add (osc::OutboundPacketStream &outPacket) const
 
std::size_t size () const
 

Description

The OSCArgument wraps an OSCValue. This class offers some utility methods to quickly work with the most common OSC values. For other / more complex OSC Value types you can ask for the value using the get<T> function. Note that this argument owns the value.

Constructor & Destructor Documentation

◆ OSCArgument() [1/3]

OSCArgument ( )
default

◆ OSCArgument() [2/3]

◆ ~OSCArgument()

~OSCArgument ( )
default

◆ OSCArgument() [3/3]

OSCArgument ( OSCArgument )
delete

Copy is not allowed

Member Function Documentation

◆ add()

void add ( osc::OutboundPacketStream &  outPacket) const

Adds the value to an OSC packet that can be send over

Parameters
outPacketthe packet to add the value to

◆ asBool()

bool asBool ( ) const
Returns
this argument's value as a bool

◆ asChar()

char asChar ( ) const
Returns
this argument's value as a char

◆ asDouble()

double asDouble ( ) const
Returns
this argument's value as a double

◆ asFloat()

float asFloat ( ) const
Returns
this argument's value as a float

◆ asInt()

int asInt ( ) const
Returns
this argument's value as an int

◆ asString()

const std::string& asString ( ) const
Returns
this argument's value as a string

◆ get() [1/2]

T * get
Returns
the value as type T, nullptr if the type doesn't match

◆ get() [2/2]

const T * get
Returns
the value as type T, nullptr if the type doesn't match

◆ getValueType()

rtti::TypeInfo getValueType ( ) const
Returns
the type of the OSC value

◆ isBool()

bool isBool ( ) const
Returns
if this argument's value is a bool

◆ isChar()

bool isChar ( ) const
Returns
if this argument's value is a char

◆ isDouble()

bool isDouble ( ) const
Returns
if this argument's value is a double

◆ isFloat()

bool isFloat ( ) const
Returns
if this argument's value is a float

◆ isInt()

bool isInt ( ) const
Returns
if this argument's value is an int

◆ isNil()

bool isNil ( ) const
Returns
if this is a null message

◆ isString()

bool isString ( ) const
Returns
if this argument's value is a string

◆ operator=()

OSCArgument& operator= ( const OSCArgument )
delete

◆ size()

std::size_t size ( ) const
Returns
the size of the value type in bytes

◆ toString()

std::string toString ( )
Returns
outValue the value as string