Arxx::Buffer::Marker Class Reference

#include <Buffer.h>

Collaboration diagram for Arxx::Buffer::Marker:

Collaboration graph
[legend]
List of all members.

Detailed Description

A marked position in a buffer, changing with content changes.


Public Types

 LEFT
 RIGHT
 BEGIN = 0
 END = 0xFFFFFFFF
enum  Alignment { LEFT, RIGHT }
enum  Position { BEGIN = 0, END = 0xFFFFFFFF }

Public Member Functions

 Marker (const Arxx::Buffer &Buffer, Arxx::Buffer::size_type stPosition=0, Arxx::Buffer::Marker::Alignment Alignment=LEFT)
 The Marker's constructor.
 ~Marker (void)
 The Marker's destructor.
Arxx::Buffer::size_type stGetPosition (void) const
 Returns the marker's current position inside the buffer.
void vSetPosition (Arxx::Buffer::size_type stPosition)
 Sets the marker's position in the buffer.
Arxx::Buffer::Marker::Alignment GetAlignment (void) const
 Returns the marker's alignment.
void vSetAlignment (Arxx::Buffer::Marker::Alignment Alignment)
 Sets the marker's alignment.
bool bIsValid (void) const
 Returns whether the marker is valid.

Private Member Functions

void vInvalidateBuffer (void)
 Invalidates the marker's associated buffer.

Private Attributes

const Arxx::Bufferm_pBuffer
 A pointer to the associated Arxx::Buffer.
Arxx::Buffer::size_type m_stPosition
 The marker's current position inside the associated Arxx::Buffer.
Alignment m_Alignment
 The marker's alignment.


Member Enumeration Documentation

enum Arxx::Buffer::Marker::Alignment

Enumerator:
LEFT 
RIGHT 

enum Arxx::Buffer::Marker::Position

Enumerator:
BEGIN 
END 


Constructor & Destructor Documentation

Arxx::Buffer::Marker::Marker ( const Arxx::Buffer Buffer,
Arxx::Buffer::size_type  stPosition = 0,
Arxx::Buffer::Marker::Alignment  Alignment = LEFT 
)

The Marker's constructor.

The constructor will call Arxx::Buffer::vRegister(this) to register the marker at the associated Arxx::Buffer.

The position is truncated at Buffer.stGetLength() if greater than that.

Arxx::Buffer::Marker::~Marker ( void   ) 

The Marker's destructor.

The destructor will call Arxx::Buffer::vUnregister(this) to unregister the marker at the associated Arxx::Buffer.


Member Function Documentation

bool Arxx::Buffer::Marker::bIsValid ( void   )  const

Returns whether the marker is valid.

Currently the only occasion when a marker might be invalid is that the associated Arxx::Buffer got destroyed.

Arxx::Buffer::Marker::Alignment Arxx::Buffer::Marker::GetAlignment ( void   )  const

Returns the marker's alignment.

See also:
Arxx::Buffer::Marker::m_Alignment

Arxx::Buffer::size_type Arxx::Buffer::Marker::stGetPosition ( void   )  const

Returns the marker's current position inside the buffer.

The position is guaranteed to be valid inside the buffer.

void Arxx::Buffer::Marker::vInvalidateBuffer ( void   )  [private]

Invalidates the marker's associated buffer.

This function sets m_pBuffer to `0`.

Calling this function invalidates the marker.

void Arxx::Buffer::Marker::vSetAlignment ( Arxx::Buffer::Marker::Alignment  Alignment  ) 

Sets the marker's alignment.

See also:
Arxx::Buffer::Marker::m_Alignment

void Arxx::Buffer::Marker::vSetPosition ( Arxx::Buffer::size_type  stPosition  ) 

Sets the marker's position in the buffer.

Will not complain about the position being behind the buffer's end but will adjust to the length.


Member Data Documentation

Alignment Arxx::Buffer::Marker::m_Alignment [private]

The marker's alignment.

The alignment of a marker can be LEFT or RIGHT and indicates where the marker moves if data is inserted at the marker's position.

The Alignment property is only of relevance if data is inserted directly at the marker's position.

const Arxx::Buffer* Arxx::Buffer::Marker::m_pBuffer [private]

A pointer to the associated Arxx::Buffer.

Is initialized by the constructor and might be set to `0` by Arxx::Buffer::Marker::vInvalidateBuffer().

Arxx::Buffer::size_type Arxx::Buffer::Marker::m_stPosition [private]

The marker's current position inside the associated Arxx::Buffer.


The documentation for this class was generated from the following files:
Generated on Tue Oct 10 11:34:44 2006 for libarxx by  doxygen 1.4.7