KiCad PCB EDA Suite
KIGFX::VERTEX_ITEM Class Reference

#include <vertex_item.h>

Public Member Functions

 VERTEX_ITEM (const VERTEX_MANAGER &aManager)
 
virtual ~VERTEX_ITEM ()
 
unsigned int GetSize () const
 Function GetSize() Returns information about number of vertices stored. More...
 
unsigned int GetOffset () const
 Function GetOffset() Returns data offset in the container. More...
 
VERTEXGetVertices () const
 Function GetVertices() Returns pointer to the data used by the VERTEX_ITEM. More...
 

Private Member Functions

void setOffset (unsigned int aOffset)
 Function SetOffset() Sets data offset in the container. More...
 
void setSize (unsigned int aSize)
 Function SetSize() Sets data size in the container. More...
 

Private Attributes

const VERTEX_MANAGERm_manager
 
unsigned int m_offset
 
unsigned int m_size
 

Friends

class CACHED_CONTAINER
 
class VERTEX_MANAGER
 

Detailed Description

Definition at line 41 of file vertex_item.h.

Constructor & Destructor Documentation

VERTEX_ITEM::VERTEX_ITEM ( const VERTEX_MANAGER aManager)
explicit

Definition at line 36 of file vertex_item.cpp.

References m_manager, and KIGFX::VERTEX_MANAGER::SetItem().

36  :
37  m_manager( aManager ), m_offset( 0 ), m_size( 0 )
38 {
39  // As the item is created, we are going to modify it, so call to SetItem() is needed
40  m_manager.SetItem( *this );
41 }
unsigned int m_size
Definition: vertex_item.h:79
const VERTEX_MANAGER & m_manager
Definition: vertex_item.h:77
void SetItem(VERTEX_ITEM &aItem) const
Function SetItem() sets an item to start its modifications.
unsigned int m_offset
Definition: vertex_item.h:78
VERTEX_ITEM::~VERTEX_ITEM ( )
virtual

Definition at line 44 of file vertex_item.cpp.

References KIGFX::VERTEX_MANAGER::FreeItem(), and m_manager.

45 {
46  m_manager.FreeItem( *this );
47 }
void FreeItem(VERTEX_ITEM &aItem) const
Function FreeItem() frees the memory occupied by the item, so it is no longer stored in the container...
const VERTEX_MANAGER & m_manager
Definition: vertex_item.h:77

Member Function Documentation

VERTEX * VERTEX_ITEM::GetVertices ( ) const

Function GetVertices() Returns pointer to the data used by the VERTEX_ITEM.

Definition at line 50 of file vertex_item.cpp.

References KIGFX::VERTEX_MANAGER::GetVertices(), and m_manager.

51 {
52  return m_manager.GetVertices( *this );
53 }
VERTEX * GetVertices(const VERTEX_ITEM &aItem) const
Function GetVertices() returns a pointer to the vertices owned by an item.
const VERTEX_MANAGER & m_manager
Definition: vertex_item.h:77
void KIGFX::VERTEX_ITEM::setOffset ( unsigned int  aOffset)
inlineprivate

Function SetOffset() Sets data offset in the container.

Parameters
aOffsetis the offset expressed as a number of vertices.

Definition at line 86 of file vertex_item.h.

Referenced by KIGFX::CACHED_CONTAINER::defragmentResize(), KIGFX::CACHED_CONTAINER::defragmentResizeMemcpy(), and KIGFX::CACHED_CONTAINER::reallocate().

87  {
88  m_offset = aOffset;
89  }
unsigned int m_offset
Definition: vertex_item.h:78
void KIGFX::VERTEX_ITEM::setSize ( unsigned int  aSize)
inlineprivate

Function SetSize() Sets data size in the container.

Parameters
aSizeis the size expressed as a number of vertices.

Definition at line 96 of file vertex_item.h.

Referenced by KIGFX::CACHED_CONTAINER::Allocate().

97  {
98  m_size = aSize;
99  }
unsigned int m_size
Definition: vertex_item.h:79

Friends And Related Function Documentation

friend class CACHED_CONTAINER
friend

Definition at line 44 of file vertex_item.h.

friend class VERTEX_MANAGER
friend

Definition at line 45 of file vertex_item.h.

Member Data Documentation

const VERTEX_MANAGER& KIGFX::VERTEX_ITEM::m_manager
private

Definition at line 77 of file vertex_item.h.

Referenced by GetVertices(), VERTEX_ITEM(), and ~VERTEX_ITEM().

unsigned int KIGFX::VERTEX_ITEM::m_offset
private

Definition at line 78 of file vertex_item.h.

Referenced by GetOffset().

unsigned int KIGFX::VERTEX_ITEM::m_size
private

Definition at line 79 of file vertex_item.h.

Referenced by GetSize().


The documentation for this class was generated from the following files: