Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Tools/Streams/StreamHandler.h File Reference

`#include "Tools/Streams/InOut.h"`
`#include "Tools/Streams/Streamable.h"`
`#include <vector>`
`#include <stack>`
`#include <typeinfo>`
`#include <ext/hash_map>`

Include dependency graph for StreamHandler.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | RegisteringAttributes
class | StreamHandler
## Defines
#define | STREAM_REGISTER_BEGIN_EXT(s)
#define | STREAM_EXT(stream, s) streamObject( stream ,s);
#define | STREAM_ENUMASINT_EXT(stream, s) streamEnum( stream , s);
#define | STREAM_ENUM_EXT(stream, s, numberOfEnumElements, getNameFunctionPtr) streamEnum( stream , s);
#define | STREAM_BASE_EXT(stream, s) streamObject( stream, s);
#define | STREAM_ARRAY_EXT(stream, s) streamStaticArray( stream, s, sizeof(s));
#define | STREAM_DYN_ARRAY_EXT(stream, s, count) streamDynamicArray( stream, s, count);
#define | STREAM_REGISTER_BEGIN()
#define | STREAM_BASE(s)
#define | STREAM(s)
#define | STREAM_ENUMASINT(s)
#define | STREAM_ENUM(s, numberOfEnumElements, getNameFunctionPtr)
#define | STREAM_ARRAY(s)
#define | STREAM_DYN_ARRAY(s, count)
#define | STREAM_REGISTER_FINISH()
## Functions
Out & | operator<< (Out &out, const StreamHandler &streamHandler)
In & | operator>> (In &in, bool &inBool)
Out & | operator<< (Out &out, bool &outBool)
template<class T> In & | streamStaticArray (In &in, T inArray[], int size)
template<class T> Out & | streamStaticArray (Out &out, T outArray[], int size)
template<class T> In & | streamDynamicArray (In &in, T *inArray, int &numberOfEntries)
template<class T> Out & | streamDynamicArray (Out &out, T *outArray, int numberOfEntries)
void | initStreamHandler (StreamHandler *streamHandlerPtr)
StreamHandler & | getStreamHandler ()
template<class T> void | streamObject (In &in, T &t)
template<class T> void | streamObject (Out &out, T &t)
template<class T> void | streamEnum (In &in, T &t)
template<class T> void | streamEnum (Out &out, T &t)

## Define Documentation

#define STREAM_REGISTER_BEGIN_EXT | ( | s |  | ) |

| Definition at line 8 of file StreamHandler.h. Referenced by operator<<(), and operator>>().

#define STREAM_EXT | ( | stream,
|  | s |  | ) | streamObject( stream ,s);

| Definition at line 10 of file StreamHandler.h. Referenced by operator<<(), and operator>>().

#define STREAM_ENUMASINT_EXT | ( | stream,
|  | s |  | ) | streamEnum( stream , s);

| Definition at line 13 of file StreamHandler.h. Referenced by BallHandling::serialize().

#define STREAM_ENUM_EXT | ( | stream,
|  | s,
|  | numberOfEnumElements,
|  | getNameFunctionPtr |  | ) | streamEnum( stream , s);

| Definition at line 16 of file StreamHandler.h.

#define STREAM_BASE_EXT | ( | stream,
|  | s |  | ) | streamObject( stream, s);

| Definition at line 19 of file StreamHandler.h. Referenced by operator<<(), and operator>>().

#define STREAM_ARRAY_EXT | ( | stream,
|  | s |  | ) | streamStaticArray( stream, s, sizeof(s));

| Definition at line 22 of file StreamHandler.h. Referenced by operator<<(), and operator>>().

#define STREAM_DYN_ARRAY_EXT | ( | stream,
|  | s,
|  | count |  | ) | streamDynamicArray( stream, s, count);

| Definition at line 25 of file StreamHandler.h. Referenced by operator<<(), and operator>>().

#define STREAM_REGISTER_BEGIN | (
|  | ) |

| Definition at line 28 of file StreamHandler.h. Referenced by Vector3< int >::serialize(), Vector2< int >::serialize(), SensorData::serialize(), PlayersPercept::serialize(), SinglePlayerPercept::serialize(), ObstaclesPercept::FreePartOfGoal::serialize(), ObstaclesPercept::Segment::serialize(), ObstaclesPercept::serialize(), MultipleBallPerceptList::serialize(), MultipleBallPerceptElement::serialize(), LinesPercept::serialize(), LinesPercept::CenterCircle::serialize(), LinesPercept::LineCrossingPoint::serialize(), LinesPercept::LinePoints::serialize(), LinesPercept::LinePoint::serialize(), LandmarksPercept::serialize(), Goal::serialize(), Flag::serialize(), ConditionalBoundary::serialize(), EdgesPercept::serialize(), EdgesPercept::Edge::serialize(), CameraParameters::serialize(), CameraInfo::serialize(), BallPercept::serialize(), MotionRequest::serialize(), JointData::serialize(), HeadMotionRequest::serialize(), HeadControlMode::serialize(), BallModel::serialize(), CommunicatedBallState::serialize(), PropagatedBallState::serialize(), SeenBallState::serialize(), BallState::serialize(), BallHandling::serialize(), GT2005SelfLocatorParameters::serialize(), and GT2005GoalRecognizer::GoalHypothesis::serialize().

#define STREAM_BASE | ( | s |  | ) |

| Value:
    if( in){ \
        if(dynamic_cast< s *>(this)) \
          this-> s ::serialize( in, out); \
        else \
          *in >> (*this); \
      }else{ \
        if(dynamic_cast< s *>(this)) \
          this-> s ::serialize( in, out); \
        else \
          *out << (*this); \
      }
Definition at line 30 of file StreamHandler.h. Referenced by LinesPercept::LinePoint::serialize(), Goal::serialize(), Flag::serialize(), CommunicatedBallState::serialize(), PropagatedBallState::serialize(), and SeenBallState::serialize().

#define STREAM | ( | s |  | ) |

| Value:
    if( in){ \
          *in >> s; \
        }else{ \
          *out << s; \
        }
Definition at line 43 of file StreamHandler.h. Referenced by Vector3< int >::serialize(), Vector2< int >::serialize(), SensorData::serialize(), PlayersPercept::serialize(), SinglePlayerPercept::serialize(), ObstaclesPercept::FreePartOfGoal::serialize(), ObstaclesPercept::Segment::serialize(), ObstaclesPercept::serialize(), MultipleBallPerceptList::serialize(), MultipleBallPerceptElement::serialize(), LinesPercept::serialize(), LinesPercept::CenterCircle::serialize(), LinesPercept::LineCrossingPoint::serialize(), LinesPercept::LinePoint::serialize(), LandmarksPercept::serialize(), Goal::serialize(), Flag::serialize(), ConditionalBoundary::serialize(), EdgesPercept::serialize(), EdgesPercept::Edge::serialize(), CameraParameters::serialize(), CameraInfo::serialize(), BallPercept::serialize(), MotionRequest::serialize(), JointData::serialize(), HeadMotionRequest::serialize(), HeadControlMode::serialize(), BallModel::serialize(), CommunicatedBallState::serialize(), PropagatedBallState::serialize(), SeenBallState::serialize(), BallState::serialize(), GT2005SelfLocatorParameters::serialize(), and GT2005GoalRecognizer::GoalHypothesis::serialize().

#define STREAM_ENUMASINT | ( | s |  | ) |

| Value:
    if( in){ \
        streamEnum( *in , s);\
      }else{ \
        streamEnum( *out , s);\
      }
Definition at line 50 of file StreamHandler.h. Referenced by ObstaclesPercept::Segment::serialize(), Goal::serialize(), and Flag::serialize().

#define STREAM_ENUM | ( | s,
|  | numberOfEnumElements,
|  | getNameFunctionPtr |  | ) |

| Value:
    if( in){ \
        streamEnum( *in , s);\
      }else{ \
        streamEnum( *out , s);\
      }
Definition at line 57 of file StreamHandler.h. Referenced by LinesPercept::LineCrossingPoint::serialize(), MotionRequest::serialize(), and HeadControlMode::serialize().

#define STREAM_ARRAY | ( | s |  | ) |

| Value:
    if(in) \
        streamStaticArray( *in, s, sizeof(s)); \
      else \
        streamStaticArray( *out, s, sizeof(s));
Definition at line 64 of file StreamHandler.h. Referenced by ObstaclesPercept::serialize(), and LinesPercept::serialize().

#define STREAM_DYN_ARRAY | ( | s,
|  | count |  | ) |

| Value:
    if(in) \
        streamDynamicArray( *in, s, count); \
      else \
        streamDynamicArray( *out, s, count);
Definition at line 70 of file StreamHandler.h. Referenced by PlayersPercept::serialize(), ObstaclesPercept::serialize(), MultipleBallPerceptList::serialize(), LinesPercept::serialize(), LinesPercept::LinePoints::serialize(), LandmarksPercept::serialize(), and EdgesPercept::serialize().

#define STREAM_REGISTER_FINISH | (
|  | ) |

| Definition at line 76 of file StreamHandler.h. Referenced by operator<<(), operator>>(), Vector3< int >::serialize(), Vector2< int >::serialize(), SensorData::serialize(), PlayersPercept::serialize(), SinglePlayerPercept::serialize(), ObstaclesPercept::FreePartOfGoal::serialize(), ObstaclesPercept::Segment::serialize(), ObstaclesPercept::serialize(), MultipleBallPerceptList::serialize(), MultipleBallPerceptElement::serialize(), LinesPercept::serialize(), LinesPercept::CenterCircle::serialize(), LinesPercept::LineCrossingPoint::serialize(), LinesPercept::LinePoints::serialize(), LinesPercept::LinePoint::serialize(), LandmarksPercept::serialize(), Goal::serialize(), Flag::serialize(), ConditionalBoundary::serialize(), EdgesPercept::serialize(), EdgesPercept::Edge::serialize(), CameraParameters::serialize(), CameraInfo::serialize(), BallPercept::serialize(), MotionRequest::serialize(), JointData::serialize(), HeadMotionRequest::serialize(), HeadControlMode::serialize(), BallModel::serialize(), CommunicatedBallState::serialize(), PropagatedBallState::serialize(), SeenBallState::serialize(), BallState::serialize(), BallHandling::serialize(), GT2005SelfLocatorParameters::serialize(), and GT2005GoalRecognizer::GoalHypothesis::serialize().

## Function Documentation

Out& operator<< | ( | Out & | out,
|  | const StreamHandler & | streamHandler
| ) |

| Definition at line 43 of file StreamHandler.cpp. References StreamHandler::basicTypeSpecification, StreamHandler::enumSpecification, out, and StreamHandler::specification.

In& operator>> | ( | In & | in,
|  | bool & | inBool
| ) |

| Definition at line 101 of file StreamHandler.cpp. References in.

Out& operator<< | ( | Out & | out,
|  | bool & | outBool
| ) |

| Definition at line 109 of file StreamHandler.cpp. References out.

template<class T>
In& streamStaticArray | ( | In & | in,
|  | T | inArray[],
|  | int | size
| ) |

| Definition at line 331 of file StreamHandler.h. References in.

template<class T>
Out& streamStaticArray | ( | Out & | out,
|  | T | outArray[],
|  | int | size
| ) |

| Definition at line 341 of file StreamHandler.h. References out.

template<class T>
In& streamDynamicArray | ( | In & | in,
|  | T * | inArray,
|  | int & | numberOfEntries
| ) |

| Definition at line 352 of file StreamHandler.h. References in.

template<class T>
Out& streamDynamicArray | ( | Out & | out,
|  | T * | outArray,
|  | int | numberOfEntries
| ) |

| Definition at line 362 of file StreamHandler.h. References out.

void initStreamHandler | ( | StreamHandler * | streamHandlerPtr | ) |

| Definition at line 91 of file StreamHandler.cpp. Referenced by Process::Process(), and Process::processMain().

StreamHandler& getStreamHandler | ( |  | ) |

| Definition at line 96 of file StreamHandler.cpp. Referenced by Cognition::main(), and SeenBallState::serialize().

template<class T>
void streamObject | ( | In & | in,
|  | T & | t
| ) |

| Definition at line 379 of file StreamHandler.h. References in.

template<class T>
void streamObject | ( | Out & | out,
|  | T & | t
| ) |

| Definition at line 384 of file StreamHandler.h. References out.

template<class T>
void streamEnum | ( | In & | in,
|  | T & | t
| ) |

| Definition at line 389 of file StreamHandler.h. References in.

template<class T>
void streamEnum | ( | Out & | out,
|  | T & | t
| ) |

| Definition at line 396 of file StreamHandler.h. References out.