GCpp general purpose C++ library  version 1.0
GSubItem Class Reference

#include <GItem.hh>

Inheritance diagram for GSubItem:
GItem GNamed

Public Member Functions

template<class Q >
bool IsInstanceOf () const
 
template<class Q >
bool IsInstanceOf ()
 
virtual GSubItemClone () const
 
virtual const char * ClassName () const
 
 GSubItem (const string &s, void *ptr=NULL, const int n=0, GItem *p=NULL)
 
 GSubItem (const GSubItem &original)
 
 GSubItem (GItem *p, const bool udat=true)
 
virtual ~GSubItem ()
 
GSubItemoperator= (const GSubItem &original)
 
bool operator== (const GSubItem &item)
 
GItemGetParentItem () const
 
void SetParentItem (GItem *par)
 
- Public Member Functions inherited from GItem
template<class Q >
bool IsInstanceOf () const
 
template<class Q >
bool IsInstanceOf ()
 
 GItem (const string &s, void *ptr=NULL, const int n=0)
 
 GItem (const GItem &original)
 
virtual ~GItem ()
 
GItemoperator= (const GItem &original)
 
bool operator== (const GItem &item)
 
int GetId () const
 
void SetId (const int n)
 
void * GetUserData () const
 
void SetUserData (void *ptr)
 
virtual string GetInfo () const
 
virtual void SetInfo (const string &info)
 
void Select (const bool b=true)
 
bool IsSelected () const
 
- Public Member Functions inherited from GNamed
template<class Q >
bool IsInstanceOf () const
 
template<class Q >
bool IsInstanceOf ()
 
 GNamed (const string &object_name="")
 
 GNamed (const GNamed &object)
 
virtual ~GNamed ()
 
GNamedoperator= (const GNamed &object)
 
virtual const string & Name () const
 
virtual string & Name ()
 
virtual string GetName () const
 
virtual void SetName (const string &object_name)
 
int Compare (const GNamed &object) const
 
int CompareDict (const GNamed &object) const
 
bool operator== (const GNamed &object) const
 
bool operator!= (const GNamed &object) const
 
bool operator< (const GNamed &object) const
 
bool operator> (const GNamed &object) const
 
bool operator<= (const GNamed &object) const
 
bool operator>= (const GNamed &object) const
 

Static Public Member Functions

static const char * StaticClassName ()
 
- Static Public Member Functions inherited from GItem
static const char * StaticClassName ()
 
- Static Public Member Functions inherited from GNamed
static const char * StaticClassName ()
 

Protected Attributes

GItemparent
 Pointer to the element in main list.
 
- Protected Attributes inherited from GItem
bool selected
 Indicates if the element is selected.
 
int id
 Identification number (for ROOT widgets)
 
void * user_data
 Pointer on user data.
 
string data_info
 More detailed information (if required)
 
- Protected Attributes inherited from GNamed
string name
 Object name.
 

Detailed Description

This class is derived from GItem, for elements of sub-lists build from a main list.

The element in the main list is refered to with the parent pointer.

This class is used for example by GItemSelectionBox widget.

Constructor & Destructor Documentation

GSubItem::GSubItem ( const string &  s,
void *  ptr = NULL,
const int  n = 0,
GItem p = NULL 
)
inline

Constructor.

Parameters
sdisplay string (name)
ptrobject (user data) pointer
nidentification number for ROOT widgets
pmain item in parent collection (list)

References parent.

GSubItem::GSubItem ( const GSubItem original)
inline

Copy constructor.

Parameters
originalitem to copy

References parent.

GSubItem::GSubItem ( GItem p,
const bool  udat = true 
)
inline

Constructor from a main list element: the argument is copied and its address is set as parent pointer.

Parameters
ppointer on parent list element
udatindicates if the user data pointer should be copied

References parent, and GItem::user_data.

GSubItem::~GSubItem ( )
inlinevirtual

Destructor.

Member Function Documentation

GItem * GSubItem::GetParentItem ( ) const
inline

Get the pointer on the parent list item.

References parent.

template<class Q >
bool GSubItem::IsInstanceOf ( ) const
inline

Macro from GCpp library that defines the following functions:

  • ClassName(): return the real class name of the object
  • StaticClassName(): return the used class name of the object (that may be a base class of the real object).
  • IsInstanceOf<T>(): return true if the current object is an instance of the template class name argument
  • Clone(): return an allocated copy of the object.
GSubItem & GSubItem::operator= ( const GSubItem original)

Affectation operator.

Parameters
originalsub-item to copy

References G_AFFECT_MOTHER, and parent.

bool GSubItem::operator== ( const GSubItem item)
inline

Comparison operator: it compares the GItem base class and the pointer to parent list item.

Parameters
itemelement to compare

References parent.

void GSubItem::SetParentItem ( GItem p)
inline

Set the pointer on the parent list item.

Parameters
pparent item pointer

References parent.


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