JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::OSCArgument Class Reference

An OSC argument. More...

#include <juce_OSCArgument.h>

Collaboration diagram for juce::OSCArgument:

Public Member Functions

 OSCArgument (const String &value)
 Constructs an OSCArgument with type string and a given value. More...
 
 OSCArgument (float value)
 Constructs an OSCArgument with type float32 and a given value. More...
 
 OSCArgument (int32 value)
 Constructs an OSCArgument with type int32 and a given value. More...
 
 OSCArgument (MemoryBlock blob)
 Constructs an OSCArgument with type blob and copies dataSize bytes from the memory pointed to by data into the blob. More...
 
 OSCArgument (OSCColour colour)
 Constructs an OSCArgument with type colour and a given colour value. 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...
 
OSCColour getColour () const noexcept
 Returns the value of the OSCArgument as an OSCColour. More...
 
float getFloat32 () const noexcept
 Returns the value of the OSCArgument as a float32. More...
 
int32 getInt32 () const noexcept
 Returns the value of the OSCArgument as an int32. More...
 
String getString () const noexcept
 Returns the value of the OSCArgument as a string. More...
 
OSCType getType () const noexcept
 Returns the type of the OSCArgument as an OSCType. More...
 
bool isBlob () const noexcept
 Returns whether the type of the OSCArgument is blob. More...
 
bool isColour () const noexcept
 Returns whether the type of the OSCArgument is colour. More...
 
bool isFloat32 () const noexcept
 Returns whether the type of the OSCArgument is float. More...
 
bool isInt32 () const noexcept
 Returns whether the type of the OSCArgument is int32. More...
 
bool isString () const noexcept
 Returns whether the type of the OSCArgument is string. More...
 

Private Attributes

union {
   float   floatValue
 
   int32   intValue
 
}; 
 
MemoryBlock blob
 
String stringValue
 
OSCType type
 

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.

@tags{OSC}

Constructor & Destructor Documentation

◆ OSCArgument() [1/5]

juce::OSCArgument::OSCArgument ( int32  value)

Constructs an OSCArgument with type int32 and a given value.

◆ OSCArgument() [2/5]

juce::OSCArgument::OSCArgument ( float  value)

Constructs an OSCArgument with type float32 and a given value.

◆ OSCArgument() [3/5]

juce::OSCArgument::OSCArgument ( const String value)

Constructs an OSCArgument with type string and a given value.

◆ OSCArgument() [4/5]

juce::OSCArgument::OSCArgument ( 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.

◆ OSCArgument() [5/5]

juce::OSCArgument::OSCArgument ( OSCColour  colour)

Constructs an OSCArgument with type colour and a given colour value.

Member Function Documentation

◆ getBlob()

const MemoryBlock& juce::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.

◆ getColour()

OSCColour juce::OSCArgument::getColour ( ) const
noexcept

Returns the value of the OSCArgument as an OSCColour.

If the type of the OSCArgument is not a colour, the behaviour is undefined.

◆ getFloat32()

float juce::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.

◆ getInt32()

int32 juce::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.

◆ getString()

String juce::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.

◆ getType()

OSCType juce::OSCArgument::getType ( ) const
inlinenoexcept

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.

References juce::gl::type.

◆ isBlob()

bool juce::OSCArgument::isBlob ( ) const
inlinenoexcept

Returns whether the type of the OSCArgument is blob.

References juce::OSCTypes::blob, and juce::gl::type.

◆ isColour()

bool juce::OSCArgument::isColour ( ) const
inlinenoexcept

Returns whether the type of the OSCArgument is colour.

References juce::OSCTypes::colour, and juce::gl::type.

◆ isFloat32()

bool juce::OSCArgument::isFloat32 ( ) const
inlinenoexcept

Returns whether the type of the OSCArgument is float.

References juce::OSCTypes::float32, and juce::gl::type.

◆ isInt32()

bool juce::OSCArgument::isInt32 ( ) const
inlinenoexcept

Returns whether the type of the OSCArgument is int32.

References juce::OSCTypes::int32, and juce::gl::type.

◆ isString()

bool juce::OSCArgument::isString ( ) const
inlinenoexcept

Returns whether the type of the OSCArgument is string.

References juce::OSCTypes::string, and juce::gl::type.

Member Data Documentation

◆ @682

union { ... }

◆ blob

MemoryBlock juce::OSCArgument::blob
private

◆ floatValue

float juce::OSCArgument::floatValue

◆ intValue

int32 juce::OSCArgument::intValue

◆ stringValue

String juce::OSCArgument::stringValue
private

◆ type

OSCType juce::OSCArgument::type
private

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