bes  Updated for version 3.20.6
bes::CatalogItem Class Reference

#include <CatalogItem.h>

Collaboration diagram for bes::CatalogItem:
Collaboration graph

Classes

struct  CatalogItemAscending
 

Public Types

enum  item_type { unknown, node, leaf }
 

Public Member Functions

 CatalogItem ()
 Make an empty instance. More...
 
 CatalogItem (const std::string &name, size_t size, const std::string &lmt, bool is_data, item_type type)
 Hold information about an item in a BES Catalog. More...
 
 CatalogItem (const std::string &name, size_t size, const std::string &lmt, item_type type)
 Hold information about an item in a BES Catalog. More...
 
virtual void dump (std::ostream &strm) const
 
void encode_item (BESInfo *info)
 Encode this CatalogItem in an info object. More...
 
std::string get_lmt () const
 Get the last modified time for this item. More...
 
std::string get_name () const
 The name of this item in the node. More...
 
size_t get_size () const
 The size (bytes) of the item. More...
 
item_type get_type () const
 Get the type of this item (unknown, node or leaf) More...
 
bool is_data () const
 Is this item recognized as data? More...
 
void set_is_data (bool id)
 Is this item data that the BES should interpret? More...
 
void set_lmt (std::string lmt)
 Set the LMT for this item. More...
 
void set_name (std::string n)
 Set the name of the item. More...
 
void set_size (size_t s)
 Set the size of the item. More...
 
void set_type (item_type t)
 Set the type for this item. More...
 

Detailed Description

An item that is part of a BES Catalog. Catalogs are a simple abstraction for a hierarchical organization of data, equivalent to a tree where a node can have zero or more leaves and zero or more child nodes. in that model, the CatalogItem is a leaf or a node. However, the CatalogItem class does not support building a tree. It will return information about the contents of a node, but not about the contents of that nodes child nodes. See CatalogNode and BESCatalog for a more complete picture of how this class is used.

In the Catalog abstraction, a leaf may be either a simple file that the BES will not process other than to stream its bytes to the client, or it may be a data file that the BES can open, read, and interpret. A node is always just a node. It may be empty, have only other nodes, have only leaves or have a combination of the two.

See also
CatalogNode
BESCatalog

Definition at line 72 of file CatalogItem.h.

Constructor & Destructor Documentation

◆ CatalogItem() [1/3]

bes::CatalogItem::CatalogItem ( )
inline

Make an empty instance.

Definition at line 88 of file CatalogItem.h.

◆ CatalogItem() [2/3]

bes::CatalogItem::CatalogItem ( const std::string &  name,
size_t  size,
const std::string &  lmt,
item_type  type 
)
inline

Hold information about an item in a BES Catalog.

Store information about an item. Sets the id_data() property to false.

To determine if a leaf item is data, the name must match a regular expression that is used to identify data objects (typically files). See BESCatalogUtils for help in doing that.

Parameters
name
size
lmt
type

Definition at line 104 of file CatalogItem.h.

◆ CatalogItem() [3/3]

bes::CatalogItem::CatalogItem ( const std::string &  name,
size_t  size,
const std::string &  lmt,
bool  is_data,
item_type  type 
)
inline

Hold information about an item in a BES Catalog.

Store information about an item. Sets the id_data() property to false.

To determine if a leaf item is data, the name must match a regular expression that is used to identify data objects (typically files). See BESCatalogUtils for help in doing that.

This const

Parameters
name
size
lmt
is_data
type

Definition at line 123 of file CatalogItem.h.

Member Function Documentation

◆ dump()

void CatalogItem::dump ( std::ostream &  strm) const
virtual

Dump out information about this object

Parameters
strmWrite to this stream

Implements BESObj.

Definition at line 90 of file CatalogItem.cc.

◆ encode_item()

void CatalogItem::encode_item ( BESInfo info)

Encode this CatalogItem in an info object.

A CatalogItem is encoded as XML using the following grammar, where XML attributes in square brackets are optional.

<item name="path" itemType="leaf|node" lastModified="date T time"
[size="size in bytes" isData="true|false"] >

The element may hold information about leaves or nodes elements.

Parameters
infoAdd information to this instance of BESInfo.
See also
CatalogItem::encode_item()

Definition at line 53 of file CatalogItem.cc.

◆ get_lmt()

std::string bes::CatalogItem::get_lmt ( ) const
inline

Get the last modified time for this item.

Definition at line 143 of file CatalogItem.h.

◆ get_name()

std::string bes::CatalogItem::get_name ( ) const
inline

The name of this item in the node.

Definition at line 133 of file CatalogItem.h.

◆ get_size()

size_t bes::CatalogItem::get_size ( ) const
inline

The size (bytes) of the item.

Definition at line 138 of file CatalogItem.h.

◆ get_type()

item_type bes::CatalogItem::get_type ( ) const
inline

Get the type of this item (unknown, node or leaf)

Definition at line 153 of file CatalogItem.h.

◆ is_data()

bool bes::CatalogItem::is_data ( ) const
inline

Is this item recognized as data?

Definition at line 148 of file CatalogItem.h.

◆ set_is_data()

void bes::CatalogItem::set_is_data ( bool  id)
inline

Is this item data that the BES should interpret?

Definition at line 150 of file CatalogItem.h.

◆ set_lmt()

void bes::CatalogItem::set_lmt ( std::string  lmt)
inline

Set the LMT for this item.

Definition at line 145 of file CatalogItem.h.

◆ set_name()

void bes::CatalogItem::set_name ( std::string  n)
inline

Set the name of the item.

Definition at line 135 of file CatalogItem.h.

◆ set_size()

void bes::CatalogItem::set_size ( size_t  s)
inline

Set the size of the item.

Definition at line 140 of file CatalogItem.h.

◆ set_type()

void bes::CatalogItem::set_type ( item_type  t)
inline

Set the type for this item.

Definition at line 155 of file CatalogItem.h.


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