INOS
|
Public Types | |
enum | { eFlgOverflowCheck = 0x00000001 , eFlgOverflowFatal = 0x00000002 , eFlgAccess = 0x00000004 , eFlgUnique = 0x00000008 } |
Queue flags. | |
Public Member Functions | |
CINOSQueue (const char *apName, uint32 auNumber, uint32 auSize) | |
Create a queue with the given name. See also Queue. | |
virtual | ~CINOSQueue () |
Destroy queue. | |
uint32 | Put (void *aData, uint32 aTimeout=0xFFFFFFFF, uint32 auFlags=0) |
Put data to queue and wait for max. auTimeout usec if queue full. | |
uint32 | Get (void *aData, uint32 aTimeout=0xFFFFFFFF) |
Get data from queue and wait for max. auTimeout usec if queue empty. | |
void | Inquiry (void *aData, uint32 &aCountOfElements) |
Gets the first element without removing it from the queue. Moreover, aCountOfElements returns the number of elements currently stored in the queue. | |
bool | InquiryAt (void *aData, uint32 auIndex) |
Gets the element at auIndex (starting from 0..numberOfElementsInQueue) without removing it from the queue. | |
void | Flush () |
Flush the queue. | |
bool | Empty () |
Get queue state. | |
uint32 | GetNumber () |
Get number of queue entries. | |
const uint32 | GetSize () const |
Return size of one queue entry. | |
const uint32 | GetMaxNumber () const |
Return maximum number of entries. | |
const uint32 * | GetAdrNumber () const |
Return address of entries counter. | |
const uint64 * | GetAdrCount () const |
Return address of overall counter. | |
void | SetFlag (uint32 auFlag) |
Set queue flag(s) | |
void | ClrFlag (uint32 auFlag) |
Clear queue flag(s) | |
uint32 | BeginAccess () |
BeginAccess Needs to be called before Access. | |
bool | Access (void *&ptrData, uint32 auIndex) |
Access Try to gain access to the data at a given index. The call needs to be embraced by calls of uint32 msr=BeginAccess and EndAccess(msr). | |
void | EndAccess (uint32 msr) |
EndAccess Needs to be called after Access. | |
![]() | |
CINOSSync (const char *aName=0, uint32 aInitialCount=0, bool aManual=false) | |
virtual | ~CINOSSync () |
Destroy sync object. | |
virtual const char * | GetName () |
Get name of sync object. | |
virtual uint32 | Wait (uint32 aTimeout=0xFFFFFFFF) |
wait for signaled state for max. aTimeout usec | |
virtual void | Signal () |
Put object into the signaled state. | |
virtual void | SignalEx (CINOSTaskExMsg *apMsg, uint32 auRplId, uint32 auAppError) |
virtual bool | MsgEvent (CINOSTaskExMsg *apMsg) |
virtual void | Reset () |
Reset object state. | |
volatile uint32 * | GetLockAdr () |
Return pointer to core locking structure. | |
virtual bool | UsesPolling () const |
bool | IsSame (CINOSSync *i_pSync) |
int | operator< (const CINOSSync &aSync) const |
int | operator== (const CINOSSync &aSync) const |
int | operator< (const char *aName) const |
int | operator== (const char *aName) const |
Protected Member Functions | |
DECLARE_DYNAMIC (CINOSQueue) | |
![]() | |
virtual bool | Signaled (CINOSSync *&aChild) |
virtual CINOSSyncNode * | GetNode () |
virtual void | SetNode (CINOSSyncNode *aNode) |
void | SignalAndUnlock (uint32 auMsr) |
Put object into the signaled state and release the core lock. | |
Protected Attributes | |
void * | pBegin |
pointer to begin of queue buffer | |
void * | pEnd |
pointer to end of queue buffer | |
void * | pPut |
pointer to actual put block | |
void * | pGet |
pointer to actual get block | |
uint32 | mNumber |
actual number of blocks in queue | |
uint32 | mSize |
size of block in queue | |
uint32 | mMaxNumber |
maximum number of blocks in queue | |
uint32 | mQueueFlags |
queue flags | |
CINOSSemaphore * | pSemaphore |
semaphore to handle the number of queue entries | |
uint64 | mCount |
overall put count | |
![]() | |
const char * | m_pName |
name of sync object | |
uint32 | m_uCount |
signaled count of object | |
bool | m_bManual |
manual object yes/no | |
tTaskId | m_idFstWaiting |
id of first task waiting for the sync object | |
tTaskId | m_idLstWaiting |
id of last task waiting for the sync object | |
SINOSCoreLock | m_Lock |
core lock | |
CINOSSyncNode * | m_pNode |
pointer to object node (if any) | |
Create a queue with the given name. See also Queue.
apName | Name of the queue |
auNumber | Requested number of queue entries |
auSize | Size [bytes] of each queue entry |
Access Try to gain access to the data at a given index. The call needs to be embraced by calls of uint32 msr=BeginAccess and EndAccess(msr).
ptrData[out] | Will receive a pointer to the data item at index auIndex upon suscess of the function, or NULL otherwise. |
auIndex | Zero-based index of the data item to access. |
uint32 CINOSQueue::BeginAccess | ( | ) |
BeginAccess Needs to be called before Access.
|
inline |
Clear queue flag(s)
auFlag | Pattern of flags to be set |
bool CINOSQueue::Empty | ( | ) |
Get queue state.
void CINOSQueue::EndAccess | ( | uint32 | msr | ) |
EndAccess Needs to be called after Access.
msr | The value returned by the previous call of BeginAccess |
uint32 CINOSQueue::Get | ( | void * | aData, |
uint32 | aTimeout = 0xFFFFFFFF |
||
) |
Get data from queue and wait for max. auTimeout usec if queue empty.
apData | Pointer to where to put the result |
auTimeout | max. time to wait if queue is empty or forever if used INOS_WAIT_FOREVER. The unit of the time is [usec] (microseconds). Set auTimeout == 100000 for example if you want to wait for max. 100ms |
Return address of overall counter.
|
inline |
Return address of entries counter.
|
inline |
Return maximum number of entries.
uint32 CINOSQueue::GetNumber | ( | ) |
Get number of queue entries.
|
inline |
Return size of one queue entry.
Gets the first element without removing it from the queue. Moreover, aCountOfElements returns the number of elements currently stored in the queue.
[in] | apData | Pointer to where to put the result |
[out] | aCountOfElements | Returns the number of elements currently stored in the queue |
Gets the element at auIndex (starting from 0..numberOfElementsInQueue) without removing it from the queue.
apData | Pointer to where to put the result |
auIndex | The n-th element (starting at 0) that should be returned. It is allowed to pass a value higher than available elements in the queue. It's even allowed to pass a number higher than the maximum elements that the queue could contain (GetSize()). |
uint32 CINOSQueue::Put | ( | void * | aData, |
uint32 | aTimeout = 0xFFFFFFFF , |
||
uint32 | auFlags = 0 |
||
) |
Put data to queue and wait for max. auTimeout usec if queue full.
apData | Pointer to data to put into queue |
auTimeout | max. time to wait if queue is full or forever if used INOS_WAIT_FOREVER. The unit of the time is [usec] (microseconds). Set auTimeout == 100000 for example if you want to wait for max. 100ms |
|
inline |
Set queue flag(s)
auFlag | Pattern of flags to be set |