EvolvingObjects
eoserial::Array Class Reference

Represents a JSON array. More...

#include <Array.h>

Inheritance diagram for eoserial::Array:
eoserial::Entity vector

List of all members.

Classes

struct  BaseAlgorithm
 Functor which determines how to retrieve the real value contained in a eoserial::Entity at a given place. More...
struct  UnpackAlgorithm
 BaseAlgorithm for retrieving primitive variables. More...
struct  UnpackObjectAlgorithm
 BaseAlgorithm for retrieving eoserial::Persistent objects. More...

Public Member Functions

void push_back (const eoserial::Printable *obj)
 Adds the serializable object as a JSON object.
void push_back (eoserial::Entity *json)
 Proxy for vector::push_back.
virtual std::ostream & print (std::ostream &out) const
 Prints the JSON array into the given stream.
 ~Array ()
 Dtor.
template<class Container , template< class T > class UnpackAlgorithm>
void deserialize (Container &array)
 General algorithm for array deserialization.

Protected Types

typedef std::vector
< eoserial::Entity * > 
ArrayChildren

Detailed Description

Represents a JSON array.

Wrapper for an array, so as to be used as a JSON object.

Definition at line 58 of file Array.h.


Member Function Documentation

void eoserial::Array::push_back ( const eoserial::Printable obj) [inline]

Adds the serializable object as a JSON object.

Parameters:
objObject which implemnets JsonSerializable.

Definition at line 68 of file Array.h.

References eoserial::Printable::pack().

Referenced by eoserial::MakeAlgorithm< T >::operator()(), eoserial::SerializablePushAlgorithm< T >::operator()(), eoserial::Parser::parseRight(), and push_back().

std::ostream & eoserial::Array::print ( std::ostream &  out) const [virtual]

Prints the JSON array into the given stream.

Parameters:
outThe stream

Implements eoserial::Entity.

Definition at line 26 of file Array.cpp.

template<class Container , template< class T > class UnpackAlgorithm>
void eoserial::Array::deserialize ( Container &  array) [inline]

General algorithm for array deserialization.

Applies the BaseAlgorithm to each contained variable in the eoserial::Array.

Definition at line 155 of file Array.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends