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

Simple, multi value (vector) synchronizeable data container, without support for pointers or types containing pointers. More...

#include <SyncMData.hh>

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

Public Member Functions

 SyncMData ()
 Initializes the SyncMData to an empty list. More...
 
 SyncMData (std::vector< TYPE > val)
 Initializes the SyncMData to the specified value. More...
 
 SyncMData (SyncMData< TYPE > &&s)
 
 operator std::vector< TYPE > () const
 Retrieves the front vector of the container. More...
 
TYPE operator[] (size_t idx) const
 Retrieves the indexed values from the front vector of the container. More...
 
SyncMData< TYPE > & operator= (std::vector< 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::SyncMData< TYPE >

Simple, multi value (vector) synchronizeable data container, without support for pointers or types containing pointers.

Observe that this container is not optimized for synchronization of large amounts of data.

Constructor & Destructor Documentation

◆ SyncMData() [1/2]

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

Initializes the SyncMData to an empty list.

◆ SyncMData() [2/2]

template<class TYPE >
gramods::gmNetwork::SyncMData< TYPE >::SyncMData ( std::vector< TYPE >  val)
inline

Initializes the SyncMData to the specified value.

Member Function Documentation

◆ decode()

template<class TYPE >
void gramods::gmNetwork::SyncMData< 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::SyncMData< 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 std::vector< TYPE >()

template<class TYPE >
gramods::gmNetwork::SyncMData< TYPE >::operator std::vector< TYPE > ( ) const
inline

Retrieves the front vector of the container.

◆ operator=()

template<class TYPE >
SyncMData<TYPE>& gramods::gmNetwork::SyncMData< TYPE >::operator= ( std::vector< TYPE >  val)
inline

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

◆ operator[]()

template<class TYPE >
TYPE gramods::gmNetwork::SyncMData< TYPE >::operator[] ( size_t  idx) const
inline

Retrieves the indexed values from the front vector of the container.

◆ update()

template<class TYPE >
void gramods::gmNetwork::SyncMData< 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: