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

Public Member Functions

virtual std::ostream & out () const
 
virtual irocreate (const std::string &a_class, const args &a_args)
 
 streamer_fac (std::ostream &a_out)
 
virtual ~streamer_fac ()
 
- Public Member Functions inherited from tools::rroot::ifac
virtual ~ifac ()
 

Protected Member Functions

 streamer_fac (const streamer_fac &a_from)
 
streamer_facoperator= (const streamer_fac &)
 

Protected Attributes

std::ostream & m_out
 

Additional Inherited Members

- Public Types inherited from tools::rroot::ifac
typedef std::map< char, void * > args
 
- Static Public Member Functions inherited from tools::rroot::ifac
static void * find_args (const args &a_args, char a_key)
 
static char arg_class ()
 
static std::string * arg_class (const args &a_args)
 

Detailed Description

Definition at line 13 of file streamer_fac.

Constructor & Destructor Documentation

◆ streamer_fac() [1/2]

tools::rroot::streamer_fac::streamer_fac ( std::ostream &  a_out)
inline

Definition at line 55 of file streamer_fac.

55 :m_out(a_out){}

◆ ~streamer_fac()

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

Definition at line 56 of file streamer_fac.

56 {}

◆ streamer_fac() [2/2]

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

Definition at line 58 of file streamer_fac.

58 : ifac(a_from),m_out(a_from.m_out){}

Member Function Documentation

◆ create()

virtual iro* tools::rroot::streamer_fac::create ( const std::string &  a_class,
const args a_args 
)
inlinevirtual

Implements tools::rroot::ifac.

Definition at line 16 of file streamer_fac.

16  {
17  // for read_sinfos() :
18  if(rcmp(a_class,"TStreamerInfo")) {
19  return new streamer_info(*this);
20  } else if(rcmp(a_class,"TObjArray")) {
21  std::string* sc = ifac::arg_class(a_args);
22  if(sc) {
23  if((*sc)==streamer_element::s_class()){
24  return new obj_array<streamer_element>(*this);
25  } else {
26  m_out << "tools::rroot::streamer_fac::create :"
27  << " Can't create TObjArray of " << *sc << "."
28  << std::endl;
29  return 0;
30  }
31  } else {
32  return new iros(*this);
33  }
34  } else if(rcmp(a_class,"TStreamerBase")
35  ||rcmp(a_class,"TStreamerBasicType")
36  ||rcmp(a_class,"TStreamerBasicPointer")
37  ||rcmp(a_class,"TStreamerObjectAny")
38  ||rcmp(a_class,"TStreamerObject")
39  ||rcmp(a_class,"TStreamerObjectPointer")
40  ||rcmp(a_class,"TStreamerString")
41  ||rcmp(a_class,"TStreamerSTL")
42  ||rcmp(a_class,"TStreamerLoop")
43  ||rcmp(a_class,"TList")
44  ) {
45  return new dummy_streamer_element();
46 
47  } else {
48  m_out << "tools::rroot::streamer_fac::create :"
49  << " dummy. Can't create object of class " << sout(a_class) << "."
50  << std::endl;
51  }
52  return 0;
53  }

◆ operator=()

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

Definition at line 59 of file streamer_fac.

59 {return *this;}

◆ out()

virtual std::ostream& tools::rroot::streamer_fac::out ( ) const
inlinevirtual

Implements tools::rroot::ifac.

Definition at line 15 of file streamer_fac.

15 {return m_out;}

Member Data Documentation

◆ m_out

std::ostream& tools::rroot::streamer_fac::m_out
protected

Definition at line 61 of file streamer_fac.


The documentation for this class was generated from the following file:
tools::rroot::streamer_element::s_class
static const std::string & s_class()
Definition: info:22
tools::rroot::streamer_fac::m_out
std::ostream & m_out
Definition: streamer_fac:61
tools::rcmp
bool rcmp(const char *a_1, const char *a_2)
Definition: rcmp:14
tools::rroot::ifac::arg_class
static char arg_class()
Definition: ifac:34