Charades
Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
LP< Derived, M, Ms > Class Template Reference

Base class which defines the interface for defining model LPs. More...

#include <lp.h>

Inheritance diagram for LP< Derived, M, Ms >:
LPBase

Public Member Functions

void forward (Event *e)
 Called by the Scheduler to forward execute e. More...
 
void reverse (Event *e)
 Called by the Scheduler to reverse execute e during a rollback. More...
 
void commit (Event *e)
 Called by the Scheduler when e is committed. More...
 
- Public Member Functions inherited from LPBase
virtual void initialize ()
 Called to initialize LP state and seed initial events.
 
virtual void finalize ()
 Called to perform any final actions before simulation exit.
 
virtual bool compare (const Event *e1, const Event *e2)
 Called by the scheduler to break ties on events with the same timestamp. More...
 
void set_current_event (Event *e)
 
Eventget_current_event () const
 
Time get_current_time () const
 
virtual void pup (PUP::er &p)
 

Static Private Member Functions

template<typename M1 >
static void register_msg_type ()
 
template<typename M1 , typename M2 , typename... M3>
static void register_msg_type ()
 

Static Private Attributes

static bool registered = false
 
static vector< DispatcherBase< Derived > * > dispatchers
 

Additional Inherited Members

- Public Attributes inherited from LPBase
LPChareowner
 The LPChare this LP object lives on.
 
unsigned gid
 The global id of this LP.
 
RNG rng
 The random number generator for this LP.
 

Detailed Description

template<typename Derived, typename M, typename... Ms>
class LP< Derived, M, Ms >

Base class which defines the interface for defining model LPs.

Parameterized by the derived class (CRTP), and the types of events it handles. Uses a DispatcherBase object to dispatch event handling to specific methods in the derived class.

Member Function Documentation

◆ commit()

template<typename Derived , typename M , typename... Ms>
void LP< Derived, M, Ms >::commit ( Event e)
inlinevirtual

Called by the Scheduler when e is committed.

Uses a dispatcher to call the correct handler on the derived class.

Reimplemented from LPBase.

◆ forward()

template<typename Derived , typename M , typename... Ms>
void LP< Derived, M, Ms >::forward ( Event e)
inlinevirtual

Called by the Scheduler to forward execute e.

Uses a dispatcher to call the correct handler on the derived class.

Reimplemented from LPBase.

◆ reverse()

template<typename Derived , typename M , typename... Ms>
void LP< Derived, M, Ms >::reverse ( Event e)
inlinevirtual

Called by the Scheduler to reverse execute e during a rollback.

Uses a dispatcher to call the correct handler on the derived class.

Reimplemented from LPBase.


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