Clipper
Public Member Functions
clipper::Container Class Reference

Definition for a generic container Object. More...

#include <container.h>

Inheritance diagram for clipper::Container:
clipper::CCell clipper::CGrid_sampling clipper::CHKL_data< T > clipper::CHKL_info clipper::CNXmap< T > clipper::CNXmap_operator< T > clipper::CResolution clipper::CSpacegroup clipper::CXmap< T >

List of all members.

Public Member Functions

 Container (const String name="")
 constructor: make null object or top object in a tree
 Container (Container &parent, const String &path)
 constructor: from any other member and a relative path
virtual void update ()
 update: hierarchical content update function
String path () const
 get the path of this tree object
String name () const
 get the name of this tree object
void set_name (const String &name)
 set the name of this tree object
bool is_destroyed_with_parent () const
 is this object to be destroyed when parent is destroyed?
void set_destroyed_with_parent (const bool d=true)
 set this object to be destroyed when parent is destroyed
void move (const String &path)
 'move' method moves this object to somewhere else in the hierarchy
bool has_parent () const
 test if this object has a parent
const Containerparent () const
 get the parent of this object
Containerparent ()
 get the parent of this object
int num_children () const
 return number of children
const Containerchild (const int &i) const
 get the i'th child of this object
Containerchild (const int &i)
 get the i'th child of this object
const Containerultimate_parent () const
 get the ultimate parent of this object - the top of the tree
Containerultimate_parent ()
 get the ultimate parent of this object - the top of the tree
Containerparent_ptr ()
 get the parent of this object (NULL on fail)
template<class T >
T * parent_of_type_ptr ()
 search up the tree for a parent of the specified type (NULL on fail)
Containerfind_path_ptr (const String &path)
 find an object using a directory-like path (NULL on fail)
virtual ~Container ()
 destructor: virtual
void debug ()

Detailed Description

Definition for a generic container Object.

Container is a definition for a generic container object with a name, parents, and children. Any object that wants to be part of the tree simply subclasses this class. The class also implements search and move objects. The tree is navigate using unix-like pathnames. A recursive update method can be overridden to update content after altering the hierarchy.

The top container in a tree is created by passing Container() as its parent.


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