gramods
Public Member Functions | Protected Member Functions | List of all members
gramods::gmNetwork::SyncSData< TYPE > Class Template Reference

Simple, single value synchronizeable data container, without support for pointers or types containing pointers. More...

#include <SyncSData.hh>

Inheritance diagram for gramods::gmNetwork::SyncSData< TYPE >:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmNetwork::SyncSData< TYPE >:
Collaboration graph
[legend]

Public Member Functions

 SyncSData ()
 Initializes without specifying value. More...
 
 SyncSData (TYPE val)
 Initializes the SyncSData to the specified value. More...
 
 SyncSData (SyncSData< TYPE > &&s)
 
 operator TYPE () const
 Retrieves the front value of the container. More...
 
TYPE operator* () const
 Retrieves the front value of the container. More...
 
SyncSData< TYPE > & operator= (TYPE val)
 Sets the back value of the container and immediately sends it to the back value of connected peers. More...
 

Protected Member Functions

void encode (std::vector< char > &d) override
 Encodes the back data of the container into the specified vector, using vector indices 1-N and leaving the zeroth cell empty. More...
 
void decode (std::vector< char > d) override
 Decodes the specified vector into the back data of the container, using vector indices 1-N. More...
 
void update () override
 Copies the back value to the front. More...
 
- Protected Member Functions inherited from gramods::gmNetwork::SyncData
void pushValue ()
 Called by sub classes when the value has been set, to push the value to peers. More...
 

Detailed Description

template<class TYPE>
class gramods::gmNetwork::SyncSData< TYPE >

Simple, single value synchronizeable data container, without support for pointers or types containing pointers.

Constructor & Destructor Documentation

◆ SyncSData() [1/2]

template<class TYPE >
gramods::gmNetwork::SyncSData< TYPE >::SyncSData ( )
inline

Initializes without specifying value.

◆ SyncSData() [2/2]

template<class TYPE >
gramods::gmNetwork::SyncSData< TYPE >::SyncSData ( TYPE  val)
inline

Initializes the SyncSData to the specified value.

Member Function Documentation

◆ decode()

template<class TYPE >
void gramods::gmNetwork::SyncSData< TYPE >::decode ( std::vector< char >  d)
inlineoverrideprotectedvirtual

Decodes the specified vector into the back data of the container, using vector indices 1-N.

Implements gramods::gmNetwork::SyncData.

◆ encode()

template<class TYPE >
void gramods::gmNetwork::SyncSData< TYPE >::encode ( std::vector< char > &  d)
inlineoverrideprotectedvirtual

Encodes the back data of the container into the specified vector, using vector indices 1-N and leaving the zeroth cell empty.

Implements gramods::gmNetwork::SyncData.

◆ operator TYPE()

template<class TYPE >
gramods::gmNetwork::SyncSData< TYPE >::operator TYPE ( ) const
inline

Retrieves the front value of the container.

◆ operator*()

template<class TYPE >
TYPE gramods::gmNetwork::SyncSData< TYPE >::operator* ( ) const
inline

Retrieves the front value of the container.

◆ operator=()

template<class TYPE >
SyncSData<TYPE>& gramods::gmNetwork::SyncSData< TYPE >::operator= ( TYPE  val)
inline

Sets the back value of the container and immediately sends it to the back value of connected peers.

◆ update()

template<class TYPE >
void gramods::gmNetwork::SyncSData< TYPE >::update ( )
inlineoverrideprotectedvirtual

Copies the back value to the front.

Implements gramods::gmNetwork::SyncData.


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