#include <fifo.h>

Public Member Functions | |
| Fifo (const Name &name) | |
| bool | is_empty () const |
| return true when the fifo is empty | |
| bool | is_full () const |
| return true when the fifo is full | |
| short | peek () const |
| return index where fifo can be read but don't increment it | |
| short | pop () |
| return index where fifo can be read and increment it | |
| short | push () |
| return index where fifo can be written and increment it | |
| short | pushable () const |
| return true when the fifo can be added at least one element | |
| short | get_capacity () const |
| return fifo depth | |
| short | get_size () const |
| return fifo usage | |
| const char * | get_name () const |
| const char * | get_full_name () const |
| name can be ([^. ]+.)*[^. ]+ | |
| Object * | get_parent () const |
| return object containing this one | |
| Object * | get_sibling () const |
| return next object with same parent or NULL if none | |
| Object * | get_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 () |
This is not a templated class on purpose. Actually sometimes, the actual content of the Fifo doesn't matter, or it may be shared by several data structures. So this class only focus on maintaining read and write indexes.
Parameters -depth, int, default 8, fifo capacity that is always rounded to a power of 2 -debug, int, default 0.
Definition at line 35 of file fifo.h.
enum Sampa::Object::Severity [protected, inherited] |
| Sampa::Fifo::Fifo | ( | const Name & | name | ) |
| bool Sampa::Fifo::is_empty | ( | ) | const [inline] |
| bool Sampa::Fifo::is_full | ( | ) | const [inline] |
| short Sampa::Fifo::peek | ( | ) | const [inline] |
| short Sampa::Fifo::pop | ( | ) | [inline] |
| short Sampa::Fifo::push | ( | ) | [inline] |
| short Sampa::Fifo::pushable | ( | ) | const [inline] |
return true when the fifo can be added at least one element
Definition at line 43 of file fifo.h.
References get_capacity().
| short Sampa::Fifo::get_capacity | ( | ) | const [inline] |
| short Sampa::Fifo::get_size | ( | ) | const [inline] |
| 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
| 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
Reimplemented in Sampa::Bridge, Sampa::Dma, Sampa::FixLatencySlave, Sampa::PeriodicTrafficGenerator, Sampa::TwoPortL1Cpu, and Sampa::StochasticCpu.
1.5.3