Apama  10.0.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
com::softwareag::connectivity::data_t Class Reference

A variant type which can be one of the following: More...

#include <sag_connectivity_cpp.hpp>

Inherits sag_underlying_data_t.

Public Member Functions

 data_t ()
 Construct an empty data_t. More...
 
 data_t (data_t &&other)
 Construct a data_t, move the contents from another data_t. More...
 
void swap (data_t &&other)
 Swap the contents of this data_t with another. More...
 
data_toperator= (data_t &&other)
 Move-assignment from another data_t. More...
 
 ~data_t ()
 For non-primitives free the underlying memory. More...
 
bool empty () const
 Returns true if this is the empty data_t. More...
 
data_t copy () const
 Return a deep copy of this data_t. More...
 
bool operator== (const data_t &other) const
 Returns true if two data_ts are deep-equals. More...
 
bool operator!= (const data_t &other) const
 Returns true if two data_ts are non-equal (deep equality) More...
 
template<typename V >
V::result_type apply_visitor (const V &v) const
 Apply a visitor (using the boost::static_visitor pattern) to this data_t. More...
 
template<typename V >
V::result_type apply_visitor (const V &v)
 Apply a visitor (using the boost::static_visitor pattern) to this data_t. More...
 
const char * type_name () const
 Return the name of the contained type as a string (mainly useful for debugging) More...
 
sag_data_tag type_tag () const
 Return the descriminator for this union (as an enum of the possible values) More...
 
 data_t (int64_t d)
 Create a data_t from an int64_t. More...
 
data_toperator= (int64_t d)
 Assign an int64_t to this, freeing the existing contents of this. More...
 
 data_t (bool b)
 Create a data_t from a bool. More...
 
data_toperator= (bool b)
 Assign a bool to this, freeing the existing contents of this. More...
 
 data_t (double d)
 Create a data_t from a double. More...
 
data_toperator= (double d)
 Assign a double to this, freeing the existing contents of this. More...
 
template<typename T >
 data_t (custom_t< T > &&d)
 Create a data_t from a custom value This is a move constructor and will leave the given custom_t empty. More...
 
template<typename T >
data_toperator= (custom_t< T > &&d)
 Assign this to a custom value, freeing the existing contents This is a move constructor and will leave the given custom_t empty. More...
 
 data_t (decimal_t d)
 Create a data_t from a decimal. More...
 
data_toperator= (decimal_t d)
 Assign this to a decimal, freeing the existing contents. More...
 
 data_t (const char *s, size_t n)
 Create a data_t from a string (copies the string). More...
 
 data_t (const char *s)
 Create a data_t from a string (copies the string). More...
 
 data_t (const std::string &s)
 Create a data_t from a string (copies the string). More...
 
data_toperator= (const char *s)
 Assign this to a string, freeing the existing contents (copies the string). More...
 
data_toperator= (const std::string &s)
 Assign this to a string, freeing the existing contents (copies the string). More...
 
 data_t (list_t &&d)
 Create a data_t from a list_t This is a move constructor and will leave the given list empty. More...
 
data_toperator= (list_t &&d)
 Assign this to a list_t, freeing the existing contents. More...
 
 data_t (map_t &&d)
 Create a data_t from a map_t This is a move constructor and will leave the given map empty. More...
 
data_toperator= (map_t &&d)
 Assign this to a map_t, freeing the existing contents. More...
 
 data_t (buffer_t &&d)
 Create a data_t from a buffer_t This is a move constructor and will leave the given buffer empty. More...
 
data_toperator= (buffer_t &&d)
 Assign this to a buffer_t, freeing the existing contents. More...
 

Detailed Description

A variant type which can be one of the following:

empty is equivalent to a null value in Java.

This is moveable, but not implicitly copyable. If you want to copy it use the .copy() method. If you want to move it use std::move().

To extract data from this variant you should either use the get<T>() free function if you know which type it is, or use the apply_visitor free function if you do not.

Constructor & Destructor Documentation

com::softwareag::connectivity::data_t::data_t ( )
inline

Construct an empty data_t.

com::softwareag::connectivity::data_t::data_t ( data_t &&  other)
inline

Construct a data_t, move the contents from another data_t.

Other will be set to the empty data_t

com::softwareag::connectivity::data_t::~data_t ( )

For non-primitives free the underlying memory.

com::softwareag::connectivity::data_t::data_t ( int64_t  d)
inlineexplicit

Create a data_t from an int64_t.

com::softwareag::connectivity::data_t::data_t ( bool  b)
inlineexplicit

Create a data_t from a bool.

com::softwareag::connectivity::data_t::data_t ( double  d)
inlineexplicit

Create a data_t from a double.

template<typename T >
com::softwareag::connectivity::data_t::data_t ( custom_t< T > &&  d)
explicit

Create a data_t from a custom value This is a move constructor and will leave the given custom_t empty.

If you want to copy it into this data_t use custom.copy() Otherwise use std::move().

com::softwareag::connectivity::data_t::data_t ( decimal_t  d)
inlineexplicit

Create a data_t from a decimal.

com::softwareag::connectivity::data_t::data_t ( const char *  s,
size_t  n 
)
explicit

Create a data_t from a string (copies the string).

Only use the first n bytes in the string. Must be a non-null utf8-encoded string.

com::softwareag::connectivity::data_t::data_t ( const char *  s)
explicit

Create a data_t from a string (copies the string).

Must be a non-null utf8-encoded string.

com::softwareag::connectivity::data_t::data_t ( const std::string &  s)
explicit

Create a data_t from a string (copies the string).

Must be utf8-encoded string.

com::softwareag::connectivity::data_t::data_t ( list_t &&  d)
explicit

Create a data_t from a list_t This is a move constructor and will leave the given list empty.

If you want to copy it into this data_t use list.copy() Otherwise use std::move().

com::softwareag::connectivity::data_t::data_t ( map_t &&  d)
explicit

Create a data_t from a map_t This is a move constructor and will leave the given map empty.

If you want to copy it into this data_t use map.copy() Otherwise use std::move().

com::softwareag::connectivity::data_t::data_t ( buffer_t &&  d)
explicit

Create a data_t from a buffer_t This is a move constructor and will leave the given buffer empty.

If you want to copy it into this data_t use buffer.copy() Otherwise use std::move().

Member Function Documentation

template<typename V >
V::result_type com::softwareag::connectivity::data_t::apply_visitor ( const V &  v) const

Apply a visitor (using the boost::static_visitor pattern) to this data_t.

This is the main mechanism for accessing the data if you don't know which type. Your visitor should implement operator() for each of the possible contained types and the appropriate method will be called, depending on which type is in the variant. If the variant is empty then the 0-args operator() will be used.

The return value of the operators will be returned from this method. Visitors must define a result_type member (or make use of boost::static_visitor, which provides this). Alternatively connectivity::visitor may be used when you only need to implement specific type visitation which also provides result_type.

template<typename V >
V::result_type com::softwareag::connectivity::data_t::apply_visitor ( const V &  v)

Apply a visitor (using the boost::static_visitor pattern) to this data_t.

This is the main mechanism for accessing the data if you don't know which type. Your visitor should implement operator() for each of the possible contained types and the appropriate method will be called, depending on which type is in the variant. If the variant is empty then the 0-args operator() will be used.

The return value of the operators will be returned from this method. Visitors must define a result_type member (or make use of boost::static_visitor, which provides this). Alternatively connectivity::visitor may be used when you only need to implement specific type visitation which also provides result_type.

data_t com::softwareag::connectivity::data_t::copy ( ) const

Return a deep copy of this data_t.

bool com::softwareag::connectivity::data_t::empty ( ) const
inline

Returns true if this is the empty data_t.

bool com::softwareag::connectivity::data_t::operator!= ( const data_t other) const
inline

Returns true if two data_ts are non-equal (deep equality)

data_t& com::softwareag::connectivity::data_t::operator= ( data_t &&  other)
inline

Move-assignment from another data_t.

Other will be set to the empty data_t and the current contents freed.

data_t& com::softwareag::connectivity::data_t::operator= ( int64_t  d)
inline

Assign an int64_t to this, freeing the existing contents of this.

data_t& com::softwareag::connectivity::data_t::operator= ( bool  b)
inline

Assign a bool to this, freeing the existing contents of this.

data_t& com::softwareag::connectivity::data_t::operator= ( double  d)
inline

Assign a double to this, freeing the existing contents of this.

template<typename T >
data_t& com::softwareag::connectivity::data_t::operator= ( custom_t< T > &&  d)
inline

Assign this to a custom value, freeing the existing contents This is a move constructor and will leave the given custom_t empty.

If you want to copy it into this data_t use custom.copy() Otherwise use std::move().

data_t& com::softwareag::connectivity::data_t::operator= ( decimal_t  d)
inline

Assign this to a decimal, freeing the existing contents.

data_t& com::softwareag::connectivity::data_t::operator= ( const char *  s)
inline

Assign this to a string, freeing the existing contents (copies the string).

Must be a non-null utf8-encoded string.

data_t& com::softwareag::connectivity::data_t::operator= ( const std::string &  s)
inline

Assign this to a string, freeing the existing contents (copies the string).

Must be utf8-encoded string.

data_t& com::softwareag::connectivity::data_t::operator= ( list_t &&  d)
inline

Assign this to a list_t, freeing the existing contents.

This is a move constructor and will leave the given list empty. If you want to copy it into this data_t use list.copy() Otherwise use std::move().

data_t& com::softwareag::connectivity::data_t::operator= ( map_t &&  d)
inline

Assign this to a map_t, freeing the existing contents.

This is a move constructor and will leave the given map empty. If you want to copy it into this data_t use map.copy() Otherwise use std::move().

data_t& com::softwareag::connectivity::data_t::operator= ( buffer_t &&  d)
inline

Assign this to a buffer_t, freeing the existing contents.

This is a move constructor and will leave the given buffer empty. If you want to copy it into this data_t use buffer.copy() Otherwise use std::move().

bool com::softwareag::connectivity::data_t::operator== ( const data_t other) const

Returns true if two data_ts are deep-equals.

void com::softwareag::connectivity::data_t::swap ( data_t &&  other)

Swap the contents of this data_t with another.

const char* com::softwareag::connectivity::data_t::type_name ( ) const
inline

Return the name of the contained type as a string (mainly useful for debugging)

sag_data_tag com::softwareag::connectivity::data_t::type_tag ( ) const
inline

Return the descriminator for this union (as an enum of the possible values)


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