Class Variant

Nested Relationships

Nested Types

Class Documentation

class Variant

Variant is an intermediate class that enables clients to pack data into types that are supported by Connected Spaces Platform replication systems.

Public Functions

Variant()

A default Variant will not have a valid type (“VariantType::InvalidType”), and will have no internal value associated.

Do not use this constructor unless you know what you are doing!

Variant(bool InBoolValue)

Construct a Variant based on a bool type.

Parameters

InBoolValue – bool : In value

Variant(double InFloatValue)

Construct a Variant based on a double-precision float type.

Parameters

InFloatValue – double : In value

Variant(int64_t InLongValue)

Construct a Variant based on a Long (uint64_t) type.

Parameters

InLongValue – int64_t : In value

Variant(const char *InStringValue)

Construct a Variant based on a cstring (const char*) type.

Parameters

InStringValue – const char* : In value

Variant(String InStringValue)

Construct a Variant based on an csp::common::String type.

Parameters

InStringValuecsp::common::String : In value

Variant(Vector3 InVector3Value)

Construct a Variant based on a csp::common::Vector3 type.

Parameters

InVector3Valuecsp::common::Vector3 : In value

Variant(Vector4 InVector4Value)

Construct a Variant based on an csp::common::Vector4 type.

Parameters

InVector4Valuecsp::common::Vector4 : In value

Variant(const Variant &Other)

Copy constructor.

Parameters

Other – const Variant&

~Variant()

Destructor.

Variant &operator=(const Variant &InValue)
bool operator==(const Variant &OtherValue) const
bool operator!=(const Variant &OtherValue) const
inline VariantType GetValueType() const

Gets the type of replicated value.

Returns

VariantType : The current variant internal type

void SetBool(bool InValue)

Sets internal variant type as a bool.

bool GetBool() const

Gets internal variant type as a bool.

Returns

bool

void SetFloat(double InValue)

Sets internal variant type as a double-precision float.

double GetFloat() const

Gets internal variant type as a double-precision float.

Returns

double

void SetInt(int64_t InValue)

Sets internal variant type as an int64_t.

int64_t GetInt() const

Gets internal variant type as a int64_t.

Returns

int16_t

void SetString(const char *InValue)

Sets internal variant type as a String.

void SetString(const String &InValue)

Sets internal variant type as a String.

const String &GetString() const

Gets internal variant type as a String.

Returns

const csp::common::String&

void SetVector3(Vector3 InValue)

Sets internal variant type as a Vector3.

Vector3 GetVector3() const

Gets internal variant type as a Vector3.

Returns

csp::common::Vector3

void SetVector4(Vector4 InValue)

Sets internal variant type as a Vector4.

Vector4 GetVector4() const

Gets internal variant type as a Vector4.

Returns

csp::common::Vector4

Public Static Functions

static size_t GetSizeOfInternalValue()

Static utility function to get the size in bytes of an InternalValue.

Returns

size_t