Skip to content

Class simtix::sim::GenericDelayQueue

template <class T, class Alloc>

ClassList > simtix > sim > GenericDelayQueue

Inherits the following classes: simtix::sim::SizedQueue, simtix::sim::Clocked

Public Types

Type Name
typedef SizedQueue< T, Alloc > sized_queue_

Public Types inherited from simtix::sim::SizedQueue

See simtix::sim::SizedQueue

Type Name
typedef std::deque< T, Alloc > deque_

Public Functions

Type Name
bool CanDeq () const
virtual std::optional< T > Deq () override
bool Enq (const T & val, int delay)
bool Enq (T && val, int delay)
GenericDelayQueue (const std::string & name, std::size_t capacity)

Public Functions inherited from simtix::sim::SizedQueue

See simtix::sim::SizedQueue

Type Name
virtual std::optional< T > Deq ()
bool Enq (const T & val)
bool Enq (T && val)
SizedQueue (std::size_t capacity)
std::size_t capacity () noexcept const
bool full () noexcept const
virtual ~SizedQueue () = default

Public Functions inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
Clocked (const std::string & name, TickPri pri=kDefaultPri)
Constructor for clocled.
const std::string & name () const
Get the name of the clocked object.
virtual ~Clocked ()

Protected Attributes

Type Name
std::deque< int > delays_

Protected Attributes inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
std::string name_
TickPri pri_

Protected Static Attributes inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
bool busy_ = true
std::map< TickPri, std::vector< Clocked * > > clocked_objs_map_
uint64_t cur_tick_ = 0

Protected Functions

Type Name
virtual bool HasPendingTasks () override
Checks if any registered clocked objects have pending tasks at the current tick.
virtual void Tick () override
Global tick function that advances the simulation by one cycle.

Protected Functions inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
virtual bool HasPendingTasks () = 0
Checks if any registered clocked objects have pending tasks at the current tick.
virtual void Tick () = 0
Global tick function that advances the simulation by one cycle.

Protected Static Functions inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
void Register (Clocked * c)
Register a clocked object to participate in tick-driven simulation.
void Unregister (Clocked * c)
Unregister a clocked object from tick-driven simulation.

Public Types Documentation

typedef sized_queue_

using simtix::sim::GenericDelayQueue< T, Alloc >::sized_queue_ =  SizedQueue<T, Alloc>;

Public Functions Documentation

function CanDeq

inline bool simtix::sim::GenericDelayQueue::CanDeq () const

function Deq

inline virtual std::optional< T > simtix::sim::GenericDelayQueue::Deq () override

Implements simtix::sim::SizedQueue::Deq


function Enq [1/2]

inline bool simtix::sim::GenericDelayQueue::Enq (
    const T & val,
    int delay
) 

function Enq [2/2]

inline bool simtix::sim::GenericDelayQueue::Enq (
    T && val,
    int delay
) 

function GenericDelayQueue

inline explicit simtix::sim::GenericDelayQueue::GenericDelayQueue (
    const std::string & name,
    std::size_t capacity
) 

Protected Attributes Documentation

variable delays_

std::deque<int> simtix::sim::GenericDelayQueue< T, Alloc >::delays_;

Protected Functions Documentation

function HasPendingTasks

Checks if any registered clocked objects have pending tasks at the current tick.

inline virtual bool simtix::sim::GenericDelayQueue::HasPendingTasks () override

Returns:

True if there are pending tasks, false otherwise.

Implements simtix::sim::Clocked::HasPendingTasks


function Tick

Global tick function that advances the simulation by one cycle.

inline virtual void simtix::sim::GenericDelayQueue::Tick () override

Call this function to drive all registered tick-driven objects.

Implements simtix::sim::Clocked::Tick



The documentation for this class was generated from the following file projects/simtix/src/simtix/sim/queue.h