Sampa::Gated< UserType > Class Template Reference

Template class to define guarded variable types. More...

#include <gated.h>

Inheritance diagram for Sampa::Gated< UserType >:

Sampa::GatedBase Sampa::ContainerObject Sampa::Object

List of all members.

Public Types

typedef GatedBase::Name Name

Public Member Functions

 Gated (const Name &name, const UserType &default_value)
void schedule (const UserType &v)
 set the next state of the variable
void force (const UserType &v)
 set the current state of the variable without wating the guard
const UserType & read () const
 read the current state of the variable
const UserType & get_next () const
 read the next state of the variable
 operator const UserType & () const
 cast to the current state of the variable
UserType * operator-> ()
void set_gate_event (EventListener &event)
const char * get_name () const
const char * get_full_name () const
 name can be ([^. ]+.)*[^. ]+
Objectget_parent () const
 return object containing this one
Objectget_sibling () const
 return next object with same parent or NULL if none
Objectget_first_child () const
 return first child object or NULL if none
int is_debug () const

Protected Types

enum  Severity { S_INFO, S_WARNING, S_ERROR, S_FATAL }

Protected Member Functions

void debug (const char *,...)
void error (Severity severity, const char *,...)
virtual void complete_restart ()


Detailed Description

template<class UserType>
class Sampa::Gated< UserType >

Template class to define guarded variable types.

Gated variable can be assigned, but the assigned value will be available only once the guarding event has been notified

Definition at line 67 of file gated.h.


Member Typedef Documentation

template<class UserType>
typedef GatedBase::Name Sampa::Gated< UserType >::Name

Definition at line 69 of file gated.h.


Member Enumeration Documentation

enum Sampa::Object::Severity [protected, inherited]

Enumerator:
S_INFO 
S_WARNING 
S_ERROR 
S_FATAL 

Definition at line 48 of file object.h.


Constructor & Destructor Documentation

template<class UserType>
Sampa::Gated< UserType >::Gated ( const Name name,
const UserType &  default_value 
)


Member Function Documentation

template<class UserType>
void Sampa::Gated< UserType >::schedule ( const UserType &  v  )  [inline]

set the next state of the variable

Definition at line 35 of file gated.cxx.

template<class UserType>
void Sampa::Gated< UserType >::force ( const UserType &  v  )  [inline]

set the current state of the variable without wating the guard

Definition at line 42 of file gated.cxx.

template<class UserType>
const UserType & Sampa::Gated< UserType >::read (  )  const [inline]

read the current state of the variable

Definition at line 100 of file gated.h.

template<class UserType>
const UserType & Sampa::Gated< UserType >::get_next (  )  const [inline]

read the next state of the variable

Definition at line 106 of file gated.h.

template<class UserType>
Sampa::Gated< UserType >::operator const UserType & (  )  const [inline]

cast to the current state of the variable

Definition at line 94 of file gated.h.

template<class UserType>
UserType* Sampa::Gated< UserType >::operator-> (  )  [inline]

Definition at line 76 of file gated.h.

void Sampa::GatedBase::set_gate_event ( EventListener event  )  [inline, inherited]

set event guarding the variable

Definition at line 88 of file gated.h.

const char* Sampa::Object::get_name (  )  const [inherited]

returns the local name

const char* Sampa::Object::get_full_name (  )  const [inherited]

name can be ([^. ]+.)*[^. ]+

Object* Sampa::Object::get_parent (  )  const [inherited]

return object containing this one

Object* Sampa::Object::get_sibling (  )  const [inherited]

return next object with same parent or NULL if none

Object* Sampa::Object::get_first_child (  )  const [inherited]

return first child object or NULL if none

int Sampa::Object::is_debug (  )  const [inline, inherited]

Definition at line 44 of file object.h.

void Sampa::Object::debug ( const char *  ,
  ... 
) [protected, inherited]

void Sampa::Object::error ( Severity  severity,
const char *  ,
  ... 
) [protected, inherited]

virtual void Sampa::Object::complete_restart (  )  [protected, virtual, inherited]

is called to finalize restart. On restart, one shall update pointers, or reopen ressources (files, ...).

Most of pointers are restored by the thanks to the post++ library provided that the CLASSINFO() was correctly set.

However, some pointers are not relocated by the library. These are for example the method pointers used for the processes. Take a look at

See also:
Module::restart_process, to see how this is handled

Reimplemented in Sampa::Bridge, Sampa::Dma, Sampa::FixLatencySlave, Sampa::PeriodicTrafficGenerator, Sampa::TwoPortL1Cpu, and Sampa::StochasticCpu.


The documentation for this class was generated from the following files:
Generated on Sat Feb 16 16:23:20 2008 for Sampa by  doxygen 1.5.3