Bond
 
Loading...
Searching...
No Matches
bond::bonded< T, Reader > Class Template Reference

Represents data for a struct T known at compile-time. More...

Public Member Functions

 bonded ()
 Default constructor. More...
 
 bonded (const bonded &bonded)
 Copy constructor. More...
 
 bonded (bonded &&bonded) BOND_NOEXCEPT_IF(&&std
 Move constructor. More...
 
template<typename U , typename ReaderT >
 bonded (const bonded< U, ReaderT > &bonded)
 Explicit up/down-casting from/to bonded of a derived type. More...
 
template<typename U >
 bonded (const U &value)
 Explicit initialization from an instance of U which is convertible to Reader. More...
 
 bonded (Reader data, bool base=false)
 Initialize from serialized data. More...
 
template<typename ReaderT >
 bonded (const bonded< void, ReaderT > &bonded)
 Explicit cast from bonded<void> More...
 
template<typename U , typename ReaderT >
 operator bonded< U, ReaderT > () const
 Implicit up-casting to bonded of a base type. More...
 
template<typename ReaderT >
 operator bonded< void, ReaderT > () const
 Implicit conversion to bonded<void> More...
 
template<typename Protocols = BuiltInProtocols, typename Writer >
void Serialize (Writer &output) const
 Serialize bonded using specified protocol writer. More...
 
template<typename X = T, typename Protocols = BuiltInProtocols>
Deserialize () const
 Deserialize an object of type X. More...
 
template<typename Protocols = BuiltInProtocols, typename X >
void Deserialize (X &var) const
 Deserialize to an object of type X. More...
 
template<typename Protocols = BuiltInProtocols, typename U >
boost::enable_if< is_marshaled_bonded< T, Reader, U > >::type Deserialize (bonded< U > &var) const
 Deserialize to a bonded More...
 
template<typename Protocols = BuiltInProtocols, typename X >
void Merge (const X &var)
 Update bonded<T> payload by merging it with an object of type X. More...
 
void Skip ()
 Skip struct data in the underlying payload. More...
 
bool operator== (const bonded &rhs) const
 Compare for equality. More...
 

Detailed Description

template<typename T, typename Reader>
class bond::bonded< T, Reader >

Represents data for a struct T known at compile-time.

See User's Manual

Constructor & Destructor Documentation

◆ bonded() [1/7]

template<typename T , typename Reader >
bond::bonded< T, Reader >::bonded ( )

Default constructor.

◆ bonded() [2/7]

template<typename T , typename Reader >
bond::bonded< T, Reader >::bonded ( const bonded< T, Reader > &  bonded)

Copy constructor.

◆ bonded() [3/7]

template<typename T , typename Reader >
bond::bonded< T, Reader >::bonded ( bonded< T, Reader > &&  bonded) &&

Move constructor.

◆ bonded() [4/7]

template<typename T , typename Reader >
template<typename U , typename ReaderT >
bond::bonded< T, Reader >::bonded ( const bonded< U, ReaderT > &  bonded)
explicit

Explicit up/down-casting from/to bonded of a derived type.

◆ bonded() [5/7]

template<typename T , typename Reader >
template<typename U >
bond::bonded< T, Reader >::bonded ( const U &  value)
explicit

Explicit initialization from an instance of U which is convertible to Reader.

When Reader is an instance of ProtocolReader template, value can be one of:

  • reference to an instance of object that is convertible to T; will store a copy of the object
  • boost::shared_ptr<U> to an object convertible to T; will store an up-casted shared_ptr
  • boost::reference_wrapper<U> to an object convertible to T; will store an up-casted raw pointer to the object

◆ bonded() [6/7]

template<typename T , typename Reader >
bond::bonded< T, Reader >::bonded ( Reader  data,
bool  base = false 
)
explicit

Initialize from serialized data.

◆ bonded() [7/7]

template<typename T , typename Reader >
template<typename ReaderT >
bond::bonded< T, Reader >::bonded ( const bonded< void, ReaderT > &  bonded)
explicit

Explicit cast from bonded<void>

Member Function Documentation

◆ Deserialize() [1/3]

template<typename T , typename Reader >
template<typename X = T, typename Protocols = BuiltInProtocols>
X bond::bonded< T, Reader >::Deserialize ( ) const

Deserialize an object of type X.

◆ Deserialize() [2/3]

template<typename T , typename Reader >
template<typename Protocols = BuiltInProtocols, typename U >
boost::enable_if< is_marshaled_bonded< T, Reader, U > >::type bond::bonded< T, Reader >::Deserialize ( bonded< U > &  var) const

Deserialize to a bonded

◆ Deserialize() [3/3]

template<typename T , typename Reader >
template<typename Protocols = BuiltInProtocols, typename X >
void bond::bonded< T, Reader >::Deserialize ( X &  var) const

Deserialize to an object of type X.

◆ Merge()

template<typename T , typename Reader >
template<typename Protocols = BuiltInProtocols, typename X >
void bond::bonded< T, Reader >::Merge ( const X &  var)

Update bonded<T> payload by merging it with an object of type X.

◆ operator bonded< U, ReaderT >()

template<typename T , typename Reader >
template<typename U , typename ReaderT >
bond::bonded< T, Reader >::operator bonded< U, ReaderT > ( ) const

Implicit up-casting to bonded of a base type.

◆ operator bonded< void, ReaderT >()

template<typename T , typename Reader >
template<typename ReaderT >
bond::bonded< T, Reader >::operator bonded< void, ReaderT > ( ) const

Implicit conversion to bonded<void>

◆ operator==()

template<typename T , typename Reader >
bool bond::bonded< T, Reader >::operator== ( const bonded< T, Reader > &  rhs) const

Compare for equality.

Returns true if both bonded point to the same instance of T or the same input stream. It does not compare values of objects T or contents of input streams.

◆ Serialize()

template<typename T , typename Reader >
template<typename Protocols = BuiltInProtocols, typename Writer >
void bond::bonded< T, Reader >::Serialize ( Writer &  output) const

Serialize bonded using specified protocol writer.

◆ Skip()

template<typename T , typename Reader >
void bond::bonded< T, Reader >::Skip ( )

Skip struct data in the underlying payload.