StreamBase C++ API
7.6.7.3
|
An object containing all the information about a data type – the primitive DataType; for DataType::TUPLEs, the Tuple's Schema; and for DataType::LISTs, the List elements' own CompleteDataType. More...
#include <CompleteDataType.hpp>
Public Member Functions | |
CompleteDataType (const CompleteDataType &cdt) | |
Copy constructor. More... | |
CompleteDataType & | operator= (const CompleteDataType &cdt) |
Assignment operator. More... | |
~CompleteDataType () | |
Destructor. More... | |
bool | operator== (const CompleteDataType &t) const |
bool | operator!= (const CompleteDataType &t) const |
bool | operator< (const CompleteDataType &t) const |
bool | operator> (const CompleteDataType &t) const |
bool | operator<= (const CompleteDataType &t) const |
bool | operator>= (const CompleteDataType &t) const |
operator const void * () const | |
int | compare (const CompleteDataType &fv) const |
Compare the current CompleteDataType against the provided CompleteDataType by base type (eg DataType::BOOL, ::INT, ::TUPLE, etc). More... | |
const DataType & | getType () const |
Return the primitive DataType of the CompleteDataType. More... | |
bool | hasSchema () |
Returns true if this CompleteDataType contains a Schema (eg it is a DataType::TUPLE). More... | |
const Schema | getSchema () const |
If this CompleteDataType has a nested tuple, return its Schema. More... | |
bool | hasElementType () const |
Returns true if this CompleteDataType has an element CompleteDataType (eg it is a DataType::LIST of DataType::INTs, the latter being its element type). More... | |
const CompleteDataType & | getElementCompleteType () const |
If this CompleteDataType has an element type, returns the element CompleteDataType. More... | |
const CompleteDataType & | getReturnType () const |
If this CompleteDataType is a function, return its return type. More... | |
const Schema & | getArgumentSchema () const |
If this CompleteDataType is a function, return its argument schema. More... | |
std::string | getCaptureTypeName () const |
std::string | as_string () const |
Returns a string representation of this CompleteDataType. More... | |
Static Public Member Functions | |
static const CompleteDataType & | forBool () |
Return a CompleteDataType of type DataType::BOOL. More... | |
static const CompleteDataType & | forInt () |
Return a CompleteDataType of type DataType::INT. More... | |
static const CompleteDataType & | forLong () |
Return a CompleteDataType of type DataType::LONG. More... | |
static const CompleteDataType & | forDouble () |
Return a CompleteDataType of type DataType::DOUBLE. More... | |
static const CompleteDataType & | forTimestamp () |
Return a CompleteDataType of type DataType::TIMESTAMP. More... | |
static const CompleteDataType & | forString () |
Return a CompleteDataType of type DataType::STRING. More... | |
static const CompleteDataType & | forBlob () |
Return a CompleteDataType of type DataType::BLOB. More... | |
static const CompleteDataType | forTuple (const Schema &s) |
Return a CompleteDataType of type DataType::TUPLE with the given Schema. More... | |
static const CompleteDataType | forList (const CompleteDataType &elemType) |
Return a CompleteDataType of type DataType::LIST with the given CompleteDataType as the type of its elements. More... | |
static const CompleteDataType | forCapture (const std::string &captureName) |
Return a CompleteDataType of type DataType::CAPTURE with the given capture type name. More... | |
static const CompleteDataType | forFunction (const Schema &argumentSchema, const CompleteDataType &returnType) |
Return a CompleteDataType of type DataType::FUNCTION with the given argument schema and return type. More... | |
static const CompleteDataType | forSimpleType (const DataType &type) |
Convenience method. More... | |
An object containing all the information about a data type – the primitive DataType; for DataType::TUPLEs, the Tuple's Schema; and for DataType::LISTs, the List elements' own CompleteDataType.
To get a CompleteDataType object, call the type-appropriate static method, eg. for a Boolean CompleteDatatType object, call CompleteDataType::forBool(); for a Tuple CompleteDataType, call CompleteDataType::forTuple(s) with some Schema s; for a List CompleteDataType, call CompleteDataType::forList(cdt) with some CompleteDataType cdt; and so on.
CompleteDataTypes are immutable; once created they may not be changed.
|
inline |
Copy constructor.
|
inline |
Destructor.
|
inline |
Returns a string representation of this CompleteDataType.
int sb::CompleteDataType::compare | ( | const CompleteDataType & | fv | ) | const |
Compare the current CompleteDataType against the provided CompleteDataType by base type (eg DataType::BOOL, ::INT, ::TUPLE, etc).
Therefore, for example a LIST of type INT and a LIST of type TUPLE are equal.
|
inlinestatic |
Return a CompleteDataType of type DataType::BLOB.
|
inlinestatic |
Return a CompleteDataType of type DataType::BOOL.
|
inlinestatic |
Return a CompleteDataType of type DataType::CAPTURE with the given capture type name.
|
inlinestatic |
Return a CompleteDataType of type DataType::DOUBLE.
|
inlinestatic |
Return a CompleteDataType of type DataType::FUNCTION with the given argument schema and return type.
|
inlinestatic |
Return a CompleteDataType of type DataType::INT.
|
inlinestatic |
Return a CompleteDataType of type DataType::LIST with the given CompleteDataType as the type of its elements.
|
inlinestatic |
Return a CompleteDataType of type DataType::LONG.
|
static |
Convenience method.
Return the CompleteDataType appropriate to the given DataType. Invalid on DataType::TUPLE and DataType::LIST, since they require extra information to fully specify their CompleteDataType.
|
inlinestatic |
Return a CompleteDataType of type DataType::STRING.
|
inlinestatic |
Return a CompleteDataType of type DataType::TIMESTAMP.
|
inlinestatic |
Return a CompleteDataType of type DataType::TUPLE with the given Schema.
|
inline |
If this CompleteDataType is a function, return its argument schema.
|
inline |
If this CompleteDataType has an element type, returns the element CompleteDataType.
For all other types, returns a null CompleteDataType.
Referenced by sb::Field::getElementCompleteType().
|
inline |
If this CompleteDataType is a function, return its return type.
|
inline |
If this CompleteDataType has a nested tuple, return its Schema.
For all other types, return a null Schema.
|
inline |
Return the primitive DataType of the CompleteDataType.
|
inline |
Returns true if this CompleteDataType has an element CompleteDataType (eg it is a DataType::LIST of DataType::INTs, the latter being its element type).
|
inline |
Returns true if this CompleteDataType contains a Schema (eg it is a DataType::TUPLE).
CompleteDataType& sb::CompleteDataType::operator= | ( | const CompleteDataType & | cdt | ) |
Assignment operator.