Class that serves as a reflective interface for the tuple types. More...
#include <SPL/Runtime/Type/Tuple.h>
Class that serves as a reflective interface for the tuple types.
SPL::Tuple::Tuple |
( |
const Tuple & |
rhs |
) |
|
|
inline |
Copy constructor
- Parameters
-
virtual SPL::Tuple::~Tuple |
( |
|
) |
|
|
inlinevirtual |
virtual bool SPL::Tuple::equals |
( |
const Tuple & |
ot |
) |
const |
|
pure virtual |
Equality comparison with another reflective tuple
- Parameters
-
ot |
reflective tuple to compare to |
- Returns
- true if equal, false otherwise
virtual Tuple* SPL::Tuple::clone |
( |
|
) |
const |
|
pure virtual |
Create a clone of the tuple object
- Returns
- clone of the tuple object
virtual Tuple& SPL::Tuple::clear |
( |
|
) |
|
|
virtual |
Clear the tuple attributes (all numeric attributes will become zero; booleans will become false; all strings, collections, and blobs will become empty; timestamps will become zero; enums will take the value of their first element; and tuples will be cleared recursively)
- Returns
- this Tuple
virtual void SPL::Tuple::reset |
( |
|
) |
|
|
pure virtual |
Reset the tuple attributes (all strings, collections, and blobs will become empty; and tuples will be reset recursively)
void SPL::Tuple::assignFrom |
( |
Tuple const & |
ot, |
|
|
bool |
typesafe = true |
|
) |
|
|
Assign this tuple using another tuple.
- Parameters
-
ot |
Other tuple to assign from. |
typesafe |
If true, expects tuples of the same type, otherwise (false) performs a partial assignment by copying only matching attributes. An attribute matches if the name is the same, and the type is either the same, or the type to be copied from is T and the type to be copied to is optional<T>. Default is false. |
- Exceptions
-
virtual void SPL::Tuple::assign |
( |
Tuple const & |
ot |
) |
|
|
pure virtual |
Assign this tuple using another tuple of the same type
- Parameters
-
ot |
other tuple to assign from |
void SPL::Tuple::swapWith |
( |
Tuple & |
ot, |
|
|
bool |
typesafe = true |
|
) |
|
|
Swap this tuple with another tuple
- Parameters
-
ot |
other tuple to swap with |
typesafe |
if true expects tuples of same type, otherwise (false) performs a partial swap |
Serialize (binary)
- Parameters
-
buf |
serialization buffer to use |
Deserialize (binary)
- Parameters
-
buf |
serialization buffer to use |
Serialize (binary)
- Parameters
-
buf |
serialization buffer to use |
Deserialize (binary)
- Parameters
-
buf |
serialization buffer to use |
virtual void SPL::Tuple::serialize |
( |
std::ostream & |
ostr |
) |
const |
|
pure virtual |
Serialize (character)
- Parameters
-
virtual void SPL::Tuple::serializeWithPrecision |
( |
std::ostream & |
ostr |
) |
const |
|
pure virtual |
Serialize (character), with maximum precision for floats
- Parameters
-
virtual void SPL::Tuple::deserialize |
( |
std::istream & |
istr, |
|
|
bool |
withSuffix = false |
|
) |
|
|
|
pure virtual |
Deserialize (character)
- Parameters
-
istr |
input stream |
withSuffix |
if true then any suffix will be consumed, otherwise (false) assume no suffix is present |
virtual size_t SPL::Tuple::hashCode |
( |
|
) |
const |
|
pure virtual |
Get hash code
- Returns
- hash code
virtual bool SPL::Tuple::isFacade |
( |
|
) |
const |
|
inlinevirtual |
Check if this a facade tuple
- Returns
- true if this is a facade tuple, false otherwise
virtual size_t SPL::Tuple::getSerializedSize |
( |
|
) |
const |
|
inlinevirtual |
Get the size in bytes when serialized
- Returns
- size in bytes when serialized
virtual unsigned char const* SPL::Tuple::getSerializedDataPtr |
( |
|
) |
const |
|
inlinevirtual |
Get the serialized data for the tuple (only if this is a facade tuple)
- Returns
- the serialized data pointer, NULL if this is not a facade tuple
const Tuple& SPL::Tuple::operator= |
( |
const Tuple & |
ot |
) |
|
|
inline |
Assign from another Tuple
- Parameters
-
ot |
other tuple to assign from |
- Returns
- this
virtual uint32_t SPL::Tuple::getNumberOfAttributes |
( |
|
) |
const |
|
pure virtual |
Get the number of attributes
- Returns
- the number of attributes
Get a begin iterator
- Returns
- begin iterator
Get a begin iterator
- Returns
- begin iterator
Get an end iterator
- Returns
- end iterator
Get an end iterator
- Returns
- end iterator
virtual TupleIterator SPL::Tuple::findAttribute |
( |
const std::string & |
attrb |
) |
|
|
pure virtual |
Find an attribute in the tuple
- Parameters
-
- Returns
- an iterator for the element if found, the end iterator otherwise
Find an attribue in the tuple
- Parameters
-
- Returns
- an iterator for the attribute if found, the end iterator otherwise
Get tuple attribue at the given index
- Parameters
-
- Returns
- a tuple attribute
- Exceptions
-
SPLRuntimeInvalidIndex |
if index is not valid |
Get tuple attribue at the given index
- Parameters
-
- Returns
- a tuple attribute
- Exceptions
-
SPLRuntimeInvalidIndex |
if index is not valid |
virtual ValueHandle SPL::Tuple::getAttributeValue |
( |
const std::string & |
attrb |
) |
|
|
pure virtual |
Get attribute value for the given attribute name Same as (*findAttribute(attrb)).getValue()
- Parameters
-
- Returns
- a value handle for the tuple attribute
- Exceptions
-
SPLRuntimeInvalidIndex |
if attribute is not in the tuple |
virtual ConstValueHandle SPL::Tuple::getAttributeValue |
( |
const std::string & |
attrb |
) |
const |
|
pure virtual |
Get attribute value for the given attribute name Same as (*findAttribute(attrb)).getValue()
- Parameters
-
- Returns
- a value handle for the tuple attribute
virtual ValueHandle SPL::Tuple::getAttributeValue |
( |
uint32_t |
index |
) |
|
|
pure virtual |
Get attribute value for the given index
- Parameters
-
- Returns
- a value handle for the tuple attribute
Get attribute value for the given index
- Parameters
-
- Returns
- a value handle for the tuple attribute
virtual const std::string& SPL::Tuple::getAttributeName |
( |
uint32_t |
index |
) |
const |
|
pure virtual |
Return the i'th attribute name
- Parameters
-
- Returns
- the attribute's name
virtual const std::tr1::unordered_map<std::string,uint32_t>& SPL::Tuple::getAttributeNames |
( |
|
) |
const |
|
pure virtual |
Return all the attributes for the Tuple
- Returns
- attribute name map
virtual void SPL::Tuple::deserializeWithNanAndInfs |
( |
std::istream & |
istr, |
|
|
bool |
withSuffix = false |
|
) |
|
|
|
pure virtual |
Deserialize with Inf and Nan (character)
- Parameters
-
istr |
input stream |
withSuffix |
if true then any suffix will be consumed, otherwise (false) assume no suffix is present |
void SPL::Tuple::toXML |
( |
std::ostream & |
ostr |
) |
const |
Serialize a Tuple to the 'serialized tuple format'
- Parameters
-
ostr |
Stream to which the tuple should be serialized |
void SPL::Tuple::fromXML |
( |
std::istream & |
istr |
) |
|
Deserialize a Tuple from the 'serialized tuple format'
- Parameters
-
istr |
Stream containing 'serialized tuple format' XML for a tuple of the same type a the current tuple. |
- Note
- the existing content of the tuple will be replaced by the values from the input stream of XML.
void SPL::Tuple::assignPayload |
( |
Tuple const & |
rhs |
) |
|
Assign the tuple's payload
- Parameters
-
rhs |
source tuple to assign payload from (if any) |
The documentation for this class was generated from the following file: