OSCArgument Class Reference

An OSC argument. More...

Public Member Functions

 OSCArgument (int32 value) noexcept
 Constructs an OSCArgument with type int32 and a given value. More...
 
 OSCArgument (float value) noexcept
 Constructs an OSCArgument with type float32 and a given value. More...
 
 OSCArgument (const String &value) noexcept
 Constructs an OSCArgument with type string and a given value. More...
 
 OSCArgument (const MemoryBlock &blob)
 Constructs an OSCArgument with type blob and copies dataSize bytes from the memory pointed to by data into the blob. More...
 
OSCType getType () const noexcept
 Returns the type of the OSCArgument as an OSCType. More...
 
bool isInt32 () const noexcept
 Returns whether the type of the OSCArgument is int32. More...
 
bool isFloat32 () const noexcept
 Returns whether the type of the OSCArgument is int32. More...
 
bool isString () const noexcept
 Returns whether the type of the OSCArgument is int32. More...
 
bool isBlob () const noexcept
 Returns whether the type of the OSCArgument is int32. More...
 
int32 getInt32 () const noexcept
 Returns the value of the OSCArgument as an int32. More...
 
float getFloat32 () const noexcept
 Returns the value of the OSCArgument as a float32. More...
 
String getString () const noexcept
 Returns the value of the OSCArgument as a string. More...
 
const MemoryBlockgetBlob () const noexcept
 Returns the binary data contained in the blob and owned by the OSCArgument, as a reference to a Juce MemoryBlock object. More...
 

Detailed Description

An OSC argument.

An OSC argument is a value of one of the following types: int32, float32, string, or blob (raw binary data).

OSCMessage objects are essentially arrays of OSCArgument objects.

Constructor & Destructor Documentation

◆ OSCArgument() [1/4]

OSCArgument::OSCArgument ( int32  value)
noexcept

Constructs an OSCArgument with type int32 and a given value.

◆ OSCArgument() [2/4]

OSCArgument::OSCArgument ( float  value)
noexcept

Constructs an OSCArgument with type float32 and a given value.

◆ OSCArgument() [3/4]

OSCArgument::OSCArgument ( const String value)
noexcept

Constructs an OSCArgument with type string and a given value.

◆ OSCArgument() [4/4]

OSCArgument::OSCArgument ( const MemoryBlock blob)

Constructs an OSCArgument with type blob and copies dataSize bytes from the memory pointed to by data into the blob.

The data owned by the blob will be released when the OSCArgument object gets destructed.

Member Function Documentation

◆ getType()

OSCType OSCArgument::getType ( ) const
noexcept

Returns the type of the OSCArgument as an OSCType.

OSCType is a char type, and its value will be the OSC type tag of the type.

◆ isInt32()

bool OSCArgument::isInt32 ( ) const
noexcept

Returns whether the type of the OSCArgument is int32.

References OSCTypes::int32.

◆ isFloat32()

bool OSCArgument::isFloat32 ( ) const
noexcept

Returns whether the type of the OSCArgument is int32.

References OSCTypes::float32.

◆ isString()

bool OSCArgument::isString ( ) const
noexcept

Returns whether the type of the OSCArgument is int32.

References OSCTypes::string.

◆ isBlob()

bool OSCArgument::isBlob ( ) const
noexcept

Returns whether the type of the OSCArgument is int32.

References OSCTypes::blob.

◆ getInt32()

int32 OSCArgument::getInt32 ( ) const
noexcept

Returns the value of the OSCArgument as an int32.

If the type of the OSCArgument is not int32, the behaviour is undefined.

◆ getFloat32()

float OSCArgument::getFloat32 ( ) const
noexcept

Returns the value of the OSCArgument as a float32.

If the type of the OSCArgument is not float32, the behaviour is undefined.

◆ getString()

String OSCArgument::getString ( ) const
noexcept

Returns the value of the OSCArgument as a string.

If the type of the OSCArgument is not string, the behaviour is undefined.

◆ getBlob()

const MemoryBlock& OSCArgument::getBlob ( ) const
noexcept

Returns the binary data contained in the blob and owned by the OSCArgument, as a reference to a Juce MemoryBlock object.

If the type of the OSCArgument is not blob, the behaviour is undefined.

Member Data Documentation

◆ intValue

int32 OSCArgument::intValue

◆ floatValue

float OSCArgument::floatValue

The documentation for this class was generated from the following file: