Eile Mit Weile
Loading...
Searching...
No Matches
UniqueSerializable Class Reference

Used to serialize game_state objects that need to be identifiable by a unique id. More...

#include <unique_serializable.hpp>

Inheritance diagram for UniqueSerializable:
Serializable Dice Figure GameState Player Space ServerGameState BenchSpace FinishArea HomeField LadderSpace NormalSpace

Public Member Functions

std::string GetId () const
 
void WriteIntoJson (rapidjson::Value &json, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > &allocator) const override
 
- Public Member Functions inherited from Serializable
virtual rapidjson::DocumentToJson () const
 
virtual void WriteIntoJson (rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const =0
 

Protected Member Functions

 UniqueSerializable ()
 
 UniqueSerializable (std::string id)
 

Protected Attributes

std::string id
 

Detailed Description

Used to serialize game_state objects that need to be identifiable by a unique id.

Constructor & Destructor Documentation

◆ UniqueSerializable() [1/2]

UniqueSerializable::UniqueSerializable ( )
protected

Constructor that generates a unqize id with uuid_generator::GenerateUuidV4

◆ UniqueSerializable() [2/2]

UniqueSerializable::UniqueSerializable ( std::string  id)
explicitprotected

Constructor that uses a given id

Member Function Documentation

◆ GetId()

std::string UniqueSerializable::GetId ( ) const

Getter for the id

◆ WriteIntoJson()

void UniqueSerializable::WriteIntoJson ( rapidjson::Value json,
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > &  allocator 
) const
override

Serializes a UniqueSerializable object into a json object.

Member Data Documentation

◆ id

std::string UniqueSerializable::id
protected

Unique id of UniqueSerializable object.


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