24#ifndef I_CatalogNode_h
25#define I_CatalogNode_h 1
34#define NODES_AND_LEAVES 1
48 std::string d_catalog_name;
54 std::vector<CatalogItem*> d_items;
60 std::vector<CatalogItem*> d_nodes;
61 std::vector<CatalogItem*> d_leaves;
69 CatalogNode() : d_name(
""), d_catalog_name(
""), d_lmt(
""), d_no_really_im_a_leaf(0){ }
71 CatalogNode(
const std::string &name) : d_name(name), d_catalog_name(
""), d_lmt(
""), d_no_really_im_a_leaf(0) { }
73 virtual ~CatalogNode();
76 void set_leaf(CatalogItem *leaf) { d_no_really_im_a_leaf = leaf; }
77 CatalogItem *get_leaf()
const {
return d_no_really_im_a_leaf; }
80 std::string
get_name()
const {
return d_name; }
90 std::string
get_lmt()
const {
return d_lmt; }
92 void set_lmt(std::string lmt) { d_lmt = lmt; }
94 typedef std::vector<CatalogItem*>::const_iterator item_citer;
95 typedef std::vector<CatalogItem*>::iterator item_iter;
98 item_citer items_begin() {
return d_items.begin(); }
99 item_citer items_end() {
return d_items.end(); }
102 size_t get_item_count()
const {
return d_items.size(); }
104 void add_item(CatalogItem *item) { d_items.push_back(item); }
108 item_iter nodes_begin() {
return d_nodes.begin(); }
109 item_iter nodes_end() {
return d_nodes.end(); }
111 size_t get_item_count()
const {
return d_nodes.size() + d_leaves.size(); }
118 item_iter leaves_begin() {
return d_leaves.begin(); }
119 item_iter leaves_end() {
return d_leaves.end(); }
129 virtual void dump(std::ostream &strm)
const;
informational response object
top level BES object to house generic methods
std::string get_lmt() const
Get the last modified time for this node.
void encode_node(BESInfo *info)
Encode this CatalogNode in an info object.
void add_node(CatalogItem *node)
Add information about an node that is in this node of the catalog.
void add_leaf(CatalogItem *leaf)
Add information about an leaf that is in this node of the catalog.
size_t get_leaf_count() const
How many leaves are in this node of the catalog?
void set_catalog_name(std::string cn)
Set the name of the catalog.
std::string get_catalog_name() const
The name of the catalog.
size_t get_node_count() const
How many nodes are in this node of the catalog?
void set_name(std::string n)
Set the name of the catalog's node.
CatalogNode()
Make an empty instance.
virtual void dump(std::ostream &strm) const
std::string get_name() const
The name of this node in the catalog.
void set_lmt(std::string lmt)
Set the LMT for this node.