Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ShapeRoot Class Reference

Parent class for all Shape<xxxData> objects. More...

#include <ShapeRoot.h>

Inheritance diagram for ShapeRoot:

Detailed Description

Parent class for all Shape<xxxData> objects.

Shape<T> points to data objects of type T within a ShapeSpace, e.g., Shape<LineData> points to a LineData object.

Creating a Shape registers the data object in the ShapeSpace and sets the refcount to 1. Copying a shape increments the refcount, and deleting a shape decrements it. If refcount goes to zero we delete the data object. If the user calls deleteShape on a Shape, we remove the shape from the ShapeSpace but don't actually delete it until the reference count goes to zero.

Definition at line 26 of file ShapeRoot.h.

List of all members.

Public Member Functions

 ShapeRoot (void)
 ShapeRoot (BaseData *p)
 The usual constructor.
 ShapeRoot (const ShapeRoot &other)
 Copy constructor: shallow copy.
virtual ~ShapeRoot (void)
void deleteShape (void)
void sanity_check (void) const
bool isValid () const
void setInvalid ()
 operator bool () const
virtual BaseDataoperator-> (void)
virtual const BaseDataoperator-> (void) const
virtual BaseDataoperator* (void)
virtual const BaseDataoperator* (void) const
virtual BaseDatagetData ()
virtual const BaseDatagetData () const
int getId () const
ShapeSpacegetSpace () const
ShapeRootoperator= (const ShapeRoot &)

virtual bool operator== (const ShapeRoot &other) const
 Shape comparison. Invalid shapes are considered equal.
virtual bool operator!= (const ShapeRoot &other) const
 Shape comparison. Invalid shapes are considered equal.

Protected Member Functions

ShapeRootaddShape (BaseData *p)

Protected Attributes

int id
BaseDatadata

Friends

class ShapeSpace
std::ostream & operator<< (std::ostream &os, const ShapeRoot &r)
std::istream & operator>> (std::istream &is, ShapeRoot &r)

Constructor & Destructor Documentation

ShapeRoot ( void   ) 

Construct a dummy ShapeRoot, e.g., so we can assign into it, or return it as an indicator of an invalid or failure result.

Definition at line 38 of file ShapeRoot.h.

ShapeRoot ( BaseData p  ) 

The usual constructor.

Definition at line 11 of file ShapeRoot.cc.

ShapeRoot ( const ShapeRoot other  ) 

Copy constructor: shallow copy.

Definition at line 15 of file ShapeRoot.cc.

~ShapeRoot ( void   )  [virtual]

Definition at line 31 of file ShapeRoot.cc.


Member Function Documentation

ShapeRoot& addShape ( BaseData p  )  [protected]

Definition at line 86 of file ShapeRoot.h.

void deleteShape ( void   ) 

Definition at line 36 of file ShapeRoot.cc.

Referenced by LineData::houghExtractLines().

virtual const BaseData& getData (  )  const [virtual]

Definition at line 69 of file ShapeRoot.h.

int getId (  )  const

Definition at line 71 of file ShapeRoot.h.

Referenced by IsLastMatch::operator()().

ShapeSpace & getSpace (  )  const

Definition at line 51 of file ShapeRoot.cc.

Referenced by TargetData::extractLineTarget().

operator bool (  )  const

Definition at line 61 of file ShapeRoot.h.

virtual bool operator!= ( const ShapeRoot other  )  const [virtual]

Shape comparison. Invalid shapes are considered equal.

Definition at line 78 of file ShapeRoot.h.

virtual const BaseData& operator* ( void   )  const [virtual]

Definition at line 67 of file ShapeRoot.h.

virtual BaseData& operator* ( void   )  [virtual]

Definition at line 66 of file ShapeRoot.h.

virtual const BaseData* operator-> ( void   )  const [virtual]

Definition at line 65 of file ShapeRoot.h.

virtual BaseData* operator-> ( void   )  [virtual]

Definition at line 64 of file ShapeRoot.h.

ShapeRoot & operator= ( const ShapeRoot src  ) 

Definition at line 21 of file ShapeRoot.cc.

bool operator== ( const ShapeRoot other  )  const [virtual]

Shape comparison. Invalid shapes are considered equal.

Definition at line 56 of file ShapeRoot.cc.

Referenced by ShapeRoot::operator!=().

void sanity_check ( void   )  const

Definition at line 41 of file ShapeRoot.cc.

Referenced by ShapeRoot::getSpace(), ShapeRoot::operator*(), and ShapeRoot::operator->().

void setInvalid (  ) 

Definition at line 56 of file ShapeRoot.h.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ShapeRoot r 
) [friend]
std::istream& operator>> ( std::istream &  is,
ShapeRoot r 
) [friend]

Definition at line 33 of file ShapeRoot.h.

friend class ShapeSpace [friend]

Definition at line 31 of file ShapeRoot.h.


Member Data Documentation


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

DualCoding 5.1CVS
Generated Mon May 9 04:56:31 2016 by Doxygen 1.6.3