Port attachable to a chunk in a buffer. More...
#include <ChunkPort.h>
Public Member Functions | |
void | AttachChunk (uint8_t *pBaseAddress, int64_t ChunkOffset, int64_t Length, bool Cache) |
Attaches the Chunk to the ChunkPort. | |
bool | AttachPort (GENAPI_NAMESPACE::IPort *pPort) |
Attaches the ChunkPort to the Port. | |
CChunkPort (IPort *pPort=NULL) | |
Constructor; can attach to a port. | |
bool | CheckChunkID (uint8_t *pChunkIDBuffer, int ChunkIDLength) |
Checks if a ChunkID matches. | |
bool | CheckChunkID (uint64_t ChunkID) |
Checks if a ChunkID matches, version using uint64_t ID representation. | |
void | ClearCache () |
Clears the chunk cache. | |
void | DetachChunk () |
Detaches the Chunk from the ChunkPort. | |
void | DetachPort () |
Detaches the ChunkPort to the Port. | |
virtual EAccessMode | GetAccessMode () const |
Get the access mode of the node. | |
int | GetChunkIDLength () |
Gets the ChunkID length. | |
virtual EInterfaceType | GetPrincipalInterfaceType () const |
Get the type of the main interface of a node. | |
virtual EYesNo | GetSwapEndianess () |
Determines if the port adapter must perform an endianess swap. | |
void | InvalidateNode () |
virtual void | Read (void *pBuffer, int64_t Address, int64_t Length) |
Reads a chunk of bytes from the port. | |
virtual void | SetPortImpl (GENAPI_NAMESPACE::IPort *pPort) |
Called from the port node to give the chunk port a pointer to itself. | |
void | UpdateBuffer (uint8_t *pBaseAddress) |
Updates the base address of the chunk. | |
virtual void | Write (const void *pBuffer, int64_t Address, int64_t Length) |
Writes a chunk of bytes to the port. | |
virtual | ~CChunkPort () |
Destructor; detaches from the port. | |
Protected Member Functions | |
CLock & | GetLock () const |
Protected Attributes | |
bool | m_CacheData |
indicates if the data needs to be cached | |
int | m_ChunkIDLength |
Length of the chunk ID buffer. | |
uint64_t | m_ChunkIDNumber |
Chunk ID stored as a number (for more straightforward access) | |
bool | m_ChunkIDNumberValid |
indicates if the m_ChunkIDNumber is valid (could be invalid eg. if the ID does not fit in 64-bit range) | |
int64_t | m_ChunkOffset |
The chunk's offset within the buffer. | |
int64_t | m_Length |
Length of the chunk. | |
int64_t | m_LengthAlloc |
Space allocated for the chunk. | |
uint8_t * | m_pBaseAddress |
Pointer to the begin of the buffer. | |
uint8_t * | m_pChunkData |
cache for the chunk data | |
uint8_t * | m_pChunkIDBuffer |
Binary version of the chunk ID. | |
CNodePtr | m_ptrPort |
Pointer to the node holding a reference to this implementation. |
Port attachable to a chunk in a buffer.
Definition at line 50 of file ChunkPort.h.
GENAPI_NAMESPACE::CChunkPort::CChunkPort | ( | IPort * | pPort = NULL | ) |
Constructor; can attach to a port.
virtual GENAPI_NAMESPACE::CChunkPort::~CChunkPort | ( | ) | [virtual] |
Destructor; detaches from the port.
void GENAPI_NAMESPACE::CChunkPort::AttachChunk | ( | uint8_t * | pBaseAddress, |
int64_t | ChunkOffset, | ||
int64_t | Length, | ||
bool | Cache | ||
) |
Attaches the Chunk to the ChunkPort.
bool GENAPI_NAMESPACE::CChunkPort::AttachPort | ( | GENAPI_NAMESPACE::IPort * | pPort | ) |
Attaches the ChunkPort to the Port.
bool GENAPI_NAMESPACE::CChunkPort::CheckChunkID | ( | uint8_t * | pChunkIDBuffer, |
int | ChunkIDLength | ||
) |
Checks if a ChunkID matches.
bool GENAPI_NAMESPACE::CChunkPort::CheckChunkID | ( | uint64_t | ChunkID | ) |
Checks if a ChunkID matches, version using uint64_t ID representation.
Clears the chunk cache.
Detaches the Chunk from the ChunkPort.
Detaches the ChunkPort to the Port.
virtual EAccessMode GENAPI_NAMESPACE::CChunkPort::GetAccessMode | ( | ) | const [virtual] |
Get the access mode of the node.
int GENAPI_NAMESPACE::CChunkPort::GetChunkIDLength | ( | ) | [inline] |
Gets the ChunkID length.
Definition at line 110 of file ChunkPort.h.
CLock& GENAPI_NAMESPACE::CChunkPort::GetLock | ( | ) | const [inline, protected] |
Definition at line 128 of file ChunkPort.h.
virtual EInterfaceType GENAPI_NAMESPACE::CChunkPort::GetPrincipalInterfaceType | ( | ) | const [virtual] |
Get the type of the main interface of a node.
virtual EYesNo GENAPI_NAMESPACE::CChunkPort::GetSwapEndianess | ( | ) | [inline, virtual] |
Determines if the port adapter must perform an endianess swap.
Definition at line 81 of file ChunkPort.h.
virtual void GENAPI_NAMESPACE::CChunkPort::Read | ( | void * | pBuffer, |
int64_t | Address, | ||
int64_t | Length | ||
) | [virtual] |
Reads a chunk of bytes from the port.
virtual void GENAPI_NAMESPACE::CChunkPort::SetPortImpl | ( | GENAPI_NAMESPACE::IPort * | pPort | ) | [virtual] |
Called from the port node to give the chunk port a pointer to itself.
void GENAPI_NAMESPACE::CChunkPort::UpdateBuffer | ( | uint8_t * | pBaseAddress | ) |
Updates the base address of the chunk.
virtual void GENAPI_NAMESPACE::CChunkPort::Write | ( | const void * | pBuffer, |
int64_t | Address, | ||
int64_t | Length | ||
) | [virtual] |
Writes a chunk of bytes to the port.
bool GENAPI_NAMESPACE::CChunkPort::m_CacheData [protected] |
indicates if the data needs to be cached
Definition at line 165 of file ChunkPort.h.
int GENAPI_NAMESPACE::CChunkPort::m_ChunkIDLength [protected] |
Length of the chunk ID buffer.
Definition at line 159 of file ChunkPort.h.
uint64_t GENAPI_NAMESPACE::CChunkPort::m_ChunkIDNumber [protected] |
Chunk ID stored as a number (for more straightforward access)
Definition at line 168 of file ChunkPort.h.
bool GENAPI_NAMESPACE::CChunkPort::m_ChunkIDNumberValid [protected] |
indicates if the m_ChunkIDNumber is valid (could be invalid eg. if the ID does not fit in 64-bit range)
Definition at line 171 of file ChunkPort.h.
int64_t GENAPI_NAMESPACE::CChunkPort::m_ChunkOffset [protected] |
The chunk's offset within the buffer.
Definition at line 144 of file ChunkPort.h.
int64_t GENAPI_NAMESPACE::CChunkPort::m_Length [protected] |
Length of the chunk.
Definition at line 147 of file ChunkPort.h.
int64_t GENAPI_NAMESPACE::CChunkPort::m_LengthAlloc [protected] |
Space allocated for the chunk.
Definition at line 150 of file ChunkPort.h.
uint8_t* GENAPI_NAMESPACE::CChunkPort::m_pBaseAddress [protected] |
Pointer to the begin of the buffer.
Definition at line 141 of file ChunkPort.h.
uint8_t* GENAPI_NAMESPACE::CChunkPort::m_pChunkData [protected] |
cache for the chunk data
Definition at line 162 of file ChunkPort.h.
uint8_t* GENAPI_NAMESPACE::CChunkPort::m_pChunkIDBuffer [protected] |
Binary version of the chunk ID.
Definition at line 156 of file ChunkPort.h.
CNodePtr GENAPI_NAMESPACE::CChunkPort::m_ptrPort [protected] |
Pointer to the node holding a reference to this implementation.
Definition at line 153 of file ChunkPort.h.