GenApi 3.5.1
Public Member Functions | Protected Attributes | List of all members
CChunkPort Class Reference

Port attachable to a chunk in a buffer.

#include <ChunkPort.h>

Inherits IPortConstruct.

Public Member Functions

 CChunkPort (IPort *pPort=NULL)
 Constructor; can attach to a port.
 
virtual ~CChunkPort ()
 Destructor; detaches from the port.
 
virtual EAccessMode GetAccessMode () const
 Get the access mode of the node.
 
virtual EInterfaceType GetPrincipalInterfaceType () const
 Get the type of the main interface of a node.
 
virtual void Read (void *pBuffer, int64_t Address, int64_t Length)
 Reads a chunk of bytes from the port.
 
virtual void Write (const void *pBuffer, int64_t Address, int64_t Length)
 Writes a chunk of bytes to the port.
 
virtual void SetPortImpl (GENAPI_NAMESPACE::IPort *pPort)
 Called from the port node to give the chunk port a pointer to itself.
 
virtual void SetPortImpl (GENAPI_NAMESPACE::IPortStacked *pPort)
 Called from the port node to give the chunk port a pointer to itself.
 
virtual EYesNo GetSwapEndianess ()
 Determines if the port adapter must perform an endianess swap.
 
bool AttachPort (GENAPI_NAMESPACE::IPort *pPort)
 Attaches the ChunkPort to the Port.
 
void DetachPort ()
 Detaches the ChunkPort to the Port.
 
void AttachChunk (uint8_t *pBaseAddress, int64_t ChunkOffset, int64_t Length, bool Cache)
 Attaches the Chunk to the ChunkPort.
 
void DetachChunk ()
 Detaches the Chunk from the ChunkPort.
 
int GetChunkIDLength ()
 Gets the ChunkID length.
 
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 UpdateBuffer (uint8_t *pBaseAddress)
 Updates the base address of the chunk.
 
void ClearCache ()
 Clears the chunk cache.
 

Protected Attributes

uint8_t * m_pBaseAddress
 Pointer to the begin of the buffer.
 
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.
 
CNodePtr m_ptrPort
 Pointer to the node holding a reference to this implementation.
 
uint8_t * m_pChunkIDBuffer
 Binary version of the chunk ID.
 
int m_ChunkIDLength
 Length of the chunk ID buffer.
 
uint8_t * m_pChunkData
 cache for the chunk data
 
bool m_CacheData
 indicates if the data needs to be cached
 
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)