MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions
MFM::ByteSerializable Class Referenceabstract

#include <ByteSerializable.h>

Inheritance diagram for MFM::ByteSerializable:
MFM::AtomSerializer< CC > MFM::DateTimeStamp MFM::IPrintMyself MFM::NullByteSerializable MFM::PacketSerializer< CC > MFM::Parameter< CC > MFM::UUID MFM::Parameter< MFM::CoreConfig > MFM::Parameter< T >

Public Types

enum  Result { UNSUPPORTED = -1, FAILURE = 0, SUCCESS = 1 }
 

Public Member Functions

virtual Result ReadFrom (ByteSource &byteSource, s32 argument=0)=0
 
virtual Result PrintTo (ByteSink &byteSink, s32 argument=0)=0
 

Detailed Description

ByteSerializable is an interface for an object that can either print itself to a ByteSink, read itself from a ByteSource, or both. By default it can do neither; if it can do both, it is strongly expected that the two operations invert each other.

Member Function Documentation

virtual Result MFM::ByteSerializable::PrintTo ( ByteSink byteSink,
s32  argument = 0 
)
pure virtual

Print a representation of this ByteSerializble to the given byteSink, with its details possibly modified by argument. The meaning of argument is unspecified except that 0 should be interpreted as a request for default, 'no modification', formatting.

Returns
UNSUPPORTED if this object doesn't support printing itself, or SUCCESS if the printing was successful and FAIL if there was any problem.

Implemented in MFM::AtomicParameter< CC >, MFM::AtomicParameter< T >, MFM::AtomicParameter< MFM::CoreConfig >, MFM::ElementParameterNeighborhood< CC, SITES >, MFM::ElementParameterBool< CC >, MFM::ElementParameterS32< CC >, MFM::ElementParameterU32< CC >, MFM::IPrintMyself, MFM::UUID, MFM::AtomSerializer< CC >, MFM::PacketSerializer< CC >, and MFM::DateTimeStamp.

virtual Result MFM::ByteSerializable::ReadFrom ( ByteSource byteSource,
s32  argument = 0 
)
pure virtual

Modify this object by reading a representation of a ByteSerializable from the given byteSource, with its details possibly modified by argument. The meaning of argument is unspecified except that 0 should be interpreted as a request for default, 'no modification', interpretation.

Returns
UNSUPPORTED if this object doesn't support reading itself, or SUCCESS if the reading was successful and FAIL if there was any problem.

Implemented in MFM::AtomicParameter< CC >, MFM::AtomicParameter< T >, MFM::AtomicParameter< MFM::CoreConfig >, MFM::ElementParameterNeighborhood< CC, SITES >, MFM::ElementParameterBool< CC >, MFM::ElementParameterS32< CC >, MFM::ElementParameterU32< CC >, MFM::IPrintMyself, MFM::UUID, MFM::PacketSerializer< CC >, MFM::AtomSerializer< CC >, and MFM::DateTimeStamp.


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