SST/macro
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
sstmac::pair_payload< T1, T2 > Class Template Reference

Network payload consisting of a value with sensible copy semantics. More...

#include <pair_payload.h>

Inheritance diagram for sstmac::pair_payload< T1, T2 >:
Inheritance graph
Collaboration diagram for sstmac::pair_payload< T1, T2 >:
Collaboration graph

Public Types

typedef sprockit::refcount_ptr< pair_payload< T1, T2 > > ptr
 
typedef sprockit::refcount_ptr< const pair_payload< T1, T2 > > const_ptr
 

Public Member Functions

virtual ~pair_payload ()
 
payload::const_ptr clone () const
 Clone this object. More...
 
std::pair< T1, T2 > data_unconst ()
 Access the underlying data in a non-const context. More...
 
const std::pair< T1, T2 > data () const
 Access the underlying data in a const context. More...
 
virtual long byte_length () const
 
virtual const payload::const_ptr add (const payload::const_ptr &other) const
 Add operator. More...
 
virtual const payload::const_ptr min (const payload::const_ptr &other) const
 Less than comparator, to only be used for the minloc mpi operation. More...
 
virtual const payload::const_ptr max (const payload::const_ptr &other) const
 Greater than comparator, to only be used for the maxloc operation. More...
 
virtual bool equals (const payload::const_ptr &other) const
 Equals comparator. More...
 
const payload::const_ptr logical_or (const payload::const_ptr &other) const
 Logical or comparator. More...
 
const payload::const_ptr logical_xor (const payload::const_ptr &other) const
 Logical xor comparator. More...
 
const payload::const_ptr logical_and (const payload::const_ptr &other) const
 Logical and comparator. More...
 
virtual void serialize_order (sprockit::spkt_serializer *ser) const
 Serialize this object into the spkt_serializer, for running in parallel simulation. More...
 
virtual std::string to_string () const
 Strinfier. More...
 

Static Public Member Functions

static pair_payload< T1, T2 >::const_ptr construct (const T1 &inval1, const T2 &inval2)
 Construct a new valuepayload. More...
 

Private Types

typedef pair_payload< T1, T2 > PairPayload
 

Private Member Functions

 pair_payload (const T1 &inval1, const T2 &inval2, size_t size=sizeof(T1)+sizeof(T2))
 Construction time. More...
 
 pair_payload (const pair_payload< T1, T2 > &other, size_t size=sizeof(T1)+sizeof(T2))
 Private copy constructor. More...
 

Private Attributes

T1 data1_
 The data we keep. More...
 
T2 data2_
 
size_t size_
 

Detailed Description

template<typename T1, typename T2>
class sstmac::pair_payload< T1, T2 >

Network payload consisting of a value with sensible copy semantics.

Don't use this for pointer types, since you will break assumptions about const-ness or protection of underlying data.

Definition at line 28 of file pair_payload.h.

Member Typedef Documentation

template<typename T1, typename T2>
typedef sprockit::refcount_ptr<const pair_payload<T1, T2> > sstmac::pair_payload< T1, T2 >::const_ptr

Definition at line 50 of file pair_payload.h.

template<typename T1, typename T2>
typedef pair_payload<T1, T2> sstmac::pair_payload< T1, T2 >::PairPayload
private

Definition at line 34 of file pair_payload.h.

template<typename T1, typename T2>
typedef sprockit::refcount_ptr<pair_payload<T1, T2> > sstmac::pair_payload< T1, T2 >::ptr

Definition at line 49 of file pair_payload.h.

Constructor & Destructor Documentation

template<typename T1, typename T2>
sstmac::pair_payload< T1, T2 >::pair_payload ( const T1 &  inval1,
const T2 &  inval2,
size_t  size = sizeof(T1) + sizeof(T2) 
)
inlineprivate

Construction time.

Definition at line 37 of file pair_payload.h.

template<typename T1, typename T2>
sstmac::pair_payload< T1, T2 >::pair_payload ( const pair_payload< T1, T2 > &  other,
size_t  size = sizeof(T1) + sizeof(T2) 
)
inlineprivate

Private copy constructor.

Definition at line 43 of file pair_payload.h.

template<typename T1, typename T2>
virtual sstmac::pair_payload< T1, T2 >::~pair_payload ( )
inlinevirtual

Definition at line 53 of file pair_payload.h.

Member Function Documentation

template<typename T1, typename T2>
virtual const payload::const_ptr sstmac::pair_payload< T1, T2 >::add ( const payload::const_ptr &  other) const
inlinevirtual

Add operator.

Parameters
other
Returns
a smart pointer to a new valuepayload object

Definition at line 91 of file pair_payload.h.

References sstmac::pair_payload< T1, T2 >::construct(), sstmac::pair_payload< T1, T2 >::data(), and ptr_safe_cast.

Here is the call graph for this function:

template<typename T1, typename T2>
virtual long sstmac::pair_payload< T1, T2 >::byte_length ( ) const
inlinevirtual

Definition at line 81 of file pair_payload.h.

References sstmac::pair_payload< T1, T2 >::size_.

template<typename T1, typename T2>
payload::const_ptr sstmac::pair_payload< T1, T2 >::clone ( ) const
inline

Clone this object.

Definition at line 64 of file pair_payload.h.

template<typename T1, typename T2>
static pair_payload<T1, T2>::const_ptr sstmac::pair_payload< T1, T2 >::construct ( const T1 &  inval1,
const T2 &  inval2 
)
inlinestatic
template<typename T1, typename T2>
const std::pair<T1, T2> sstmac::pair_payload< T1, T2 >::data ( ) const
inline
template<typename T1, typename T2>
std::pair<T1, T2> sstmac::pair_payload< T1, T2 >::data_unconst ( )
inline

Access the underlying data in a non-const context.

Definition at line 70 of file pair_payload.h.

References sstmac::pair_payload< T1, T2 >::data1_, and sstmac::pair_payload< T1, T2 >::data2_.

template<typename T1, typename T2>
virtual bool sstmac::pair_payload< T1, T2 >::equals ( const payload::const_ptr &  other) const
inlinevirtual

Equals comparator.

Parameters
other
Returns

Definition at line 144 of file pair_payload.h.

References sstmac::pair_payload< T1, T2 >::data(), and ptr_safe_cast.

Here is the call graph for this function:

template<typename T1, typename T2>
const payload::const_ptr sstmac::pair_payload< T1, T2 >::logical_and ( const payload::const_ptr &  other) const
inline

Logical and comparator.

Parameters
other
Returns

Definition at line 179 of file pair_payload.h.

References spkt_throw_printf.

template<typename T1, typename T2>
const payload::const_ptr sstmac::pair_payload< T1, T2 >::logical_or ( const payload::const_ptr &  other) const
inline

Logical or comparator.

Parameters
other
Returns

Definition at line 157 of file pair_payload.h.

References spkt_throw_printf.

template<typename T1, typename T2>
const payload::const_ptr sstmac::pair_payload< T1, T2 >::logical_xor ( const payload::const_ptr &  other) const
inline

Logical xor comparator.

Parameters
other
Returns

Definition at line 168 of file pair_payload.h.

References spkt_throw_printf.

template<typename T1, typename T2>
virtual const payload::const_ptr sstmac::pair_payload< T1, T2 >::max ( const payload::const_ptr &  other) const
inlinevirtual

Greater than comparator, to only be used for the maxloc operation.

Parameters
other
Returns

Definition at line 125 of file pair_payload.h.

References sstmac::pair_payload< T1, T2 >::construct(), and ptr_safe_cast.

Here is the call graph for this function:

template<typename T1, typename T2>
virtual const payload::const_ptr sstmac::pair_payload< T1, T2 >::min ( const payload::const_ptr &  other) const
inlinevirtual

Less than comparator, to only be used for the minloc mpi operation.

Parameters
other
Returns

Definition at line 106 of file pair_payload.h.

References sstmac::pair_payload< T1, T2 >::construct(), sstmac::pair_payload< T1, T2 >::data(), and ptr_safe_cast.

Here is the call graph for this function:

template<typename T1, typename T2>
virtual void sstmac::pair_payload< T1, T2 >::serialize_order ( sprockit::spkt_serializer *  ser) const
inlinevirtual

Serialize this object into the spkt_serializer, for running in parallel simulation.

Parameters
serthe serializer to use

Definition at line 190 of file pair_payload.h.

References spkt_throw_printf.

template<typename T1, typename T2>
virtual std::string sstmac::pair_payload< T1, T2 >::to_string ( ) const
inlinevirtual

Strinfier.

Returns
a std::string description

Definition at line 199 of file pair_payload.h.

Member Data Documentation

template<typename T1, typename T2>
T1 sstmac::pair_payload< T1, T2 >::data1_
mutableprivate

The data we keep.

Definition at line 31 of file pair_payload.h.

Referenced by sstmac::pair_payload< T1, T2 >::data(), and sstmac::pair_payload< T1, T2 >::data_unconst().

template<typename T1, typename T2>
T2 sstmac::pair_payload< T1, T2 >::data2_
mutableprivate
template<typename T1, typename T2>
size_t sstmac::pair_payload< T1, T2 >::size_
private

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