Sampa::EventListenerSingle Class Reference

#include <event.h>

Inheritance diagram for Sampa::EventListenerSingle:

Sampa::Object Sampa::ClockedEventSingle Sampa::EventListener Sampa::EventSingle Sampa::ClockedEvent Sampa::Event

List of all members.

Public Member Functions

 EventListenerSingle (const Name &)
 can be named for tracing purpose
EventListenerSingleoperator= (const EventListenerSingle &)
 to foward an event known at binding time
EventListenerSingleoperator= (const TemporaryEventExpression &)
 to store the result or an event expression
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

This listens an event, and can be subscribed by a process or a gated variable it is aimed at being used internally to a module to store a reference to an event emitted by another module, or an internal event expression. Then only one process or a gated variable at once can be sensitive to this listener. In case of doubt,you should prefer EventListener which has a similar behavior, but no constraints on the number of sensitivity The rationale for EventListenerSingle is that it is very slightly more efficient than an EventListener

Definition at line 90 of file event.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

Sampa::EventListenerSingle::EventListenerSingle ( const Name  ) 

can be named for tracing purpose


Member Function Documentation

EventListenerSingle& Sampa::EventListenerSingle::operator= ( const EventListenerSingle  ) 

to foward an event known at binding time

EventListenerSingle& Sampa::EventListenerSingle::operator= ( const TemporaryEventExpression &   ) 

to store the result or an event expression

Reimplemented in Sampa::EventListener.

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 file:
Generated on Sat Feb 16 16:23:19 2008 for Sampa by  doxygen 1.5.3