g4tools  5.4.0
Public Member Functions | Protected Member Functions | List of all members
tools::rroot::TDirectory Class Reference
Inheritance diagram for tools::rroot::TDirectory:
Inheritance graph
[legend]
Collaboration diagram for tools::rroot::TDirectory:
Collaboration graph
[legend]

Public Member Functions

 TDirectory (ifile &a_file)
 
virtual ~TDirectory ()
 
bool stream (buffer &a_buffer)
 
- Public Member Functions inherited from tools::rroot::directory
 directory (ifile &a_file)
 
virtual ~directory ()
 
ifilefile ()
 
const std::vector< key * > & keys () const
 
std::vector< key * > & keys ()
 
keyfind_key (const std::string &a_name)
 
keyfind_key_from_class (const std::string &a_class)
 
uint32 nbytes_name () const
 
seek seek_keys () const
 
uint32 record_size (uint32 a_version) const
 
bool from_buffer (const char *aEOB, char *&a_buffer)
 
bool read_keys (uint32 &a_number)
 
void clear_keys ()
 

Protected Member Functions

 TDirectory (const TDirectory &a_from)
 
TDirectoryoperator= (const TDirectory &)
 
void initialize ()
 
- Protected Member Functions inherited from tools::rroot::directory
 directory (const directory &a_from)
 
directoryoperator= (const directory &)
 

Additional Inherited Members

- Static Public Member Functions inherited from tools::rroot::directory
static const std::string & s_class ()
 
- Protected Attributes inherited from tools::rroot::directory
ifilem_file
 
std::vector< key * > m_keys
 
date m_date_C
 
date m_date_M
 
uint32 m_nbytes_keys
 
uint32 m_nbytes_name
 
seek m_seek_directory
 
seek m_seek_parent
 
seek m_seek_keys
 

Detailed Description

Definition at line 778 of file streamers.

Constructor & Destructor Documentation

◆ TDirectory() [1/2]

tools::rroot::TDirectory::TDirectory ( ifile a_file)
inline

Definition at line 782 of file streamers.

782 :directory(a_file){}

◆ ~TDirectory()

virtual tools::rroot::TDirectory::~TDirectory ( )
inlinevirtual

Definition at line 783 of file streamers.

783 {}

◆ TDirectory() [2/2]

tools::rroot::TDirectory::TDirectory ( const TDirectory a_from)
inlineprotected

Definition at line 785 of file streamers.

785 :directory(a_from){}

Member Function Documentation

◆ initialize()

void tools::rroot::TDirectory::initialize ( )
inlineprotected

Definition at line 831 of file streamers.

831  {
832  // Initialise directory to defaults :
833  // If directory is created via default ctor (when dir is read from file)
834  // don't add it here to the directory since its name is not yet known.
835  // It will be added to the directory in TKey::ReadObj().
836  m_date_C = 0;//m_date_C.set();
837  m_date_M = 0;//m_date_M.set();
838  m_nbytes_keys = 0;
839  m_seek_directory = 0;
840  m_seek_parent = 0;
841  m_seek_keys = 0;
842  }

◆ operator=()

TDirectory& tools::rroot::TDirectory::operator= ( const TDirectory )
inlineprotected

Definition at line 786 of file streamers.

786 {return *this;}

◆ stream()

bool tools::rroot::TDirectory::stream ( buffer a_buffer)
inline

Definition at line 788 of file streamers.

788  {
789  initialize();
790  short version;
791  if(!a_buffer.read_version(version)) return false;
792  unsigned int _date;
793  if(!a_buffer.read(_date)) return false;
794  //m_date_C.setDate(_date);
795  if(!a_buffer.read(_date)) return false;
796  //m_date_M.setDate(_date);
797  if(!a_buffer.read(m_nbytes_keys)) return false;
798  if(!a_buffer.read(m_nbytes_name)) return false;
800  if(!a_buffer.read(m_seek_directory)) return false;
801  if(!a_buffer.read(m_seek_parent)) return false;
802  if(!a_buffer.read(m_seek_keys)) return false;
803  } else {
804  {seek32 i;
805  if(!a_buffer.read(i)) return false;
806  m_seek_directory = i;}
807 
808  {seek32 i;
809  if(!a_buffer.read(i)) return false;
810  m_seek_parent = i;}
811 
812  {seek32 i;
813  if(!a_buffer.read(i)) return false;
814  m_seek_keys = i;}
815  }
816  //short v = version%big_file_version_tag();
817 
818  if (m_seek_keys) {
819  uint32 n;
820  if(!read_keys(n)) {
821  a_buffer.out() << "tools::rroot::TDirectory::stream :"
822  << " cannot read keys."
823  << std::endl;
824  return false;
825  }
826  }
827 
828  return true;
829  }

The documentation for this class was generated from the following file:
tools::rroot::seek32
int seek32
Definition: seek:17
tools::rroot::directory::m_nbytes_name
uint32 m_nbytes_name
Definition: directory:187
tools::rroot::big_file_version_tag
uint32 big_file_version_tag()
Definition: seek:19
tools::rroot::directory::m_seek_directory
seek m_seek_directory
Definition: directory:188
tools::version
unsigned int version()
Definition: version:14
tools::rroot::directory::m_seek_keys
seek m_seek_keys
Definition: directory:190
tools::rroot::directory::directory
directory(ifile &a_file)
Definition: directory:24
tools::rroot::directory::m_date_M
date m_date_M
Definition: directory:185
tools::rroot::directory::m_seek_parent
seek m_seek_parent
Definition: directory:189
tools::rroot::directory::read_keys
bool read_keys(uint32 &a_number)
Definition: directory:144
tools::rroot::directory::m_date_C
date m_date_C
Definition: directory:184
tools::rroot::TDirectory::initialize
void initialize()
Definition: streamers:831
tools::rroot::directory::m_nbytes_keys
uint32 m_nbytes_keys
Definition: directory:186
tools::uint32
unsigned int uint32
Definition: typedefs:71