Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
JGIZMO::JManager< JKey_t, JValue_t > Class Template Reference

Auxiliary class to manage set of compatible ROOT objects (e.g. More...

#include <JManager.hh>

Inheritance diagram for JGIZMO::JManager< JKey_t, JValue_t >:
JLANG::JPointer< JClass_t > std::map< JKey_t, JPointer< JValue_t > > JLANG::JAbstractPointer< JClass_t > JLANG::JEquals< JAbstractPointer< JClass_t > >

Public Types

typedef JPointer< JValue_t > ptr_type
 
typedef std::map< JKey_t,
ptr_type
map_type
 

Public Member Functions

 JManager ()
 Default constructor. More...
 
 JManager (JValue_t *master, char wildcard= '%', std::ios::fmtflags format=std::ios::fmtflags())
 Constructor. More...
 
 JManager (JValue_t *master, char wildcard, std::ios::fmtflags format, const std::string &name)
 Constructor. More...
 
 JManager (const JManager &manager)
 Copy constructor. More...
 
void clear ()
 Clear client objects. More...
 
JValue_t * operator[] (JKey_t key)
 Get pointer to object for given key. More...
 
void Read (TDirectory &in)
 Read objects from file. More...
 
void Write (TDirectory &out, const bool wm=false)
 Write objects to file. More...
 
void Write (const char *file_name, const bool wm=false)
 Write objects to file. More...
 
virtual JClass_t * get () const
 Get pointer. More...
 
virtual void set (JClass_t *p)
 Set pointer. More...
 
template<class T >
void set (const JPointer< T > &pointer)
 Set pointer. More...
 
virtual void reset ()
 Reset pointer. More...
 
template<class T >
void reset (const JPointer< T > &pointer)
 Reset pointer. More...
 
void reset (JClass_t *p)
 Reset pointer. More...
 
JClass_t *const & getReference () const
 Get rereference to internal pointer. More...
 
JClass_t *& getReference ()
 Get rereference to internal pointer. More...
 
virtual bool equals (const JAbstractPointer &object) const
 Equals. More...
 
bool is_valid () const
 Check validity of pointer. More...
 
JClass_t * operator-> () const
 Smart pointer operator. More...
 
 operator JClass_t * () const
 Type conversion operator. More...
 

Static Public Member Functions

static JManager Read (TDirectory &in, const char *const master, const char wildcard)
 Read objects from file into manager. More...
 

Public Attributes

char wc
 
std::ios::fmtflags fmt
 

Protected Attributes

JClass_t * __p
 pointer to object More...
 

Friends

TFile & operator>> (TFile &file, JManager &object)
 Read manager from file. More...
 
TFile & operator<< (TFile &file, JManager &object)
 Write manager to file. More...
 

Detailed Description

template<class JKey_t, class JValue_t>
class JGIZMO::JManager< JKey_t, JValue_t >

Auxiliary class to manage set of compatible ROOT objects (e.g.

histograms) using unique keys.
For each use of the map operator [], it is checked whether the corresponding client object exists.
If the corresponding client object does not yet exists, a clone is made of the master object (i.e. the 'client').
The name of the newly created object is derived from the name of the master object by replacing the wild card character with the value of the key according the optional format specifier.

Definition at line 42 of file JManager.hh.

Member Typedef Documentation

template<class JKey_t, class JValue_t>
typedef JPointer<JValue_t> JGIZMO::JManager< JKey_t, JValue_t >::ptr_type

Definition at line 48 of file JManager.hh.

template<class JKey_t, class JValue_t>
typedef std::map<JKey_t, ptr_type> JGIZMO::JManager< JKey_t, JValue_t >::map_type

Definition at line 49 of file JManager.hh.

Constructor & Destructor Documentation

template<class JKey_t, class JValue_t>
JGIZMO::JManager< JKey_t, JValue_t >::JManager ( )
inline

Default constructor.

Definition at line 54 of file JManager.hh.

55  {}
template<class JKey_t, class JValue_t>
JGIZMO::JManager< JKey_t, JValue_t >::JManager ( JValue_t *  master,
char  wildcard = '%',
std::ios::fmtflags  format = std::ios::fmtflags() 
)
inline

Constructor.

Note that the manager owns the master object pointed to.
For saving the objects to file, use method JManager::Write (all objects are detached from the current ROOT directory).

Parameters
mastermaster object
wildcardwild card character
formatformat specifier for replacement of wildcard character by value of key

Definition at line 69 of file JManager.hh.

71  :
73  map_type(),
74  wc (wildcard),
75  fmt(format)
76  {
77  using namespace std;
78  using namespace JPP;
79 
80  if (!this->is_valid()) {
81  THROW(JException, "No valid master");
82  }
83 
84  if (string(this->get()->GetName()).find(wc) == string::npos) {
85  THROW(JException, "Invalid wildcard <" << this->get()->GetName() << "> '" << wc << "'");
86  }
87 
88  resetObject(this->get(), true);
89  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
std::ios::fmtflags fmt
Definition: JManager.hh:353
then echo Test string reversed by master(hit< return > to continue)." JProcess -c "JEcho" -rC fi if (( 1 ))
bool is_valid() const
Check validity of pointer.
std::map< JKey_t, ptr_type > map_type
Definition: JManager.hh:49
bool resetObject(JManager< JKey_t, JValue_t > *object, const bool reset=false)
Reset JManager object.
Definition: JManager.hh:365
JPointer< JValue_t > ptr_type
Definition: JManager.hh:48
template<class JKey_t, class JValue_t>
JGIZMO::JManager< JKey_t, JValue_t >::JManager ( JValue_t *  master,
char  wildcard,
std::ios::fmtflags  format,
const std::string &  name 
)
inline

Constructor.

Note that the manager owns the master object pointed to.
For saving the objects to file, use method JManager::Write (all objects are detached from the current ROOT directory).

Parameters
mastermaster object
wildcardwild card character
formatformat specifier for replacement of wildcard character by value of key
namename of master

Definition at line 104 of file JManager.hh.

107  :
108  ptr_type(master),
109  map_type(),
110  wc (wildcard),
111  fmt(format)
112  {
113  using namespace std;
114  using namespace JPP;
115 
116  if (!this->is_valid()) {
117  THROW(JException, "No valid master");
118  }
119 
120  this->get()->SetName(name.c_str());
121 
122  if (string(this->get()->GetName()).find(wc) == string::npos) {
123  THROW(JException, "Invalid wildcard <" << this->get()->GetName() << "> '" << wc << "'");
124  }
125 
126  resetObject(this->get(), true);
127  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
std::ios::fmtflags fmt
Definition: JManager.hh:353
then echo Test string reversed by master(hit< return > to continue)." JProcess -c "JEcho" -rC fi if (( 1 ))
bool is_valid() const
Check validity of pointer.
std::map< JKey_t, ptr_type > map_type
Definition: JManager.hh:49
then echo n User name
Definition: JCookie.sh:45
bool resetObject(JManager< JKey_t, JValue_t > *object, const bool reset=false)
Reset JManager object.
Definition: JManager.hh:365
JPointer< JValue_t > ptr_type
Definition: JManager.hh:48
template<class JKey_t, class JValue_t>
JGIZMO::JManager< JKey_t, JValue_t >::JManager ( const JManager< JKey_t, JValue_t > &  manager)
inline

Copy constructor.

Note that the master object of the given manager is cloned and the wildcard copied.
The client objects are not copied.

Parameters
managermanager

Definition at line 138 of file JManager.hh.

138  :
139  ptr_type(NULL),
140  map_type(),
141  wc (manager.wc),
142  fmt(manager.fmt)
143  {
144  using namespace JPP;
145 
146  if (manager.is_valid()) {
147 
148  this->set((JValue_t*) manager.get()->Clone());
149 
150  resetObject(this->get(), true);
151  }
152  }
std::ios::fmtflags fmt
Definition: JManager.hh:353
bool is_valid() const
Check validity of pointer.
std::map< JKey_t, ptr_type > map_type
Definition: JManager.hh:49
virtual JClass_t * get() const
Get pointer.
Definition: JPointer.hh:64
bool resetObject(JManager< JKey_t, JValue_t > *object, const bool reset=false)
Reset JManager object.
Definition: JManager.hh:365
JPointer< JValue_t > ptr_type
Definition: JManager.hh:48
virtual void set(JClass_t *p)
Set pointer.
Definition: JPointer.hh:75

Member Function Documentation

template<class JKey_t, class JValue_t>
void JGIZMO::JManager< JKey_t, JValue_t >::clear ( )
inline

Clear client objects.

Definition at line 158 of file JManager.hh.

159  {
160  for (typename map_type::iterator i = this->begin(); i != this->end(); ++i) {
161  i->second.reset();
162  }
163 
164  this->clear();
165  }
void clear()
Clear client objects.
Definition: JManager.hh:158
template<class JKey_t, class JValue_t>
JValue_t* JGIZMO::JManager< JKey_t, JValue_t >::operator[] ( JKey_t  key)
inline

Get pointer to object for given key.

Parameters
keykey
Returns
pointer to client object

Definition at line 174 of file JManager.hh.

175  {
176  using namespace std;
177  using namespace JPP;
178 
179  typename map_type::iterator i = this->find(key);
180 
181  if (i == this->end()) {
182 
183  string buffer = this->get()->GetName();
184  string::size_type ipos = buffer.find(wc);
185 
186  ostringstream os;
187 
188  os.setf(fmt);
189 
190  os << key;
191 
192  buffer.replace(ipos, 1, os.str());
193 
194  JValue_t* p = (JValue_t*) this->get()->Clone(buffer.c_str());
195 
196  resetObject(p, true);
197 
198  this->insert(make_pair(key,p));
199 
200  return p;
201 
202  } else {
203 
204  return i->second;
205  }
206  }
std::ios::fmtflags fmt
Definition: JManager.hh:353
bool resetObject(JManager< JKey_t, JValue_t > *object, const bool reset=false)
Reset JManager object.
Definition: JManager.hh:365
template<class JKey_t, class JValue_t>
static JManager JGIZMO::JManager< JKey_t, JValue_t >::Read ( TDirectory &  in,
const char *const  master,
const char  wildcard 
)
inlinestatic

Read objects from file into manager.

Parameters
ininput file or directory
mastermaster name
wildcardwild card character
Returns
manager

Definition at line 217 of file JManager.hh.

218  {
219  using namespace std;
220  using namespace JPP;
221 
222  JManager manager;
223 
224  TString buffer = master;
225 
226  const Ssiz_t pos = buffer.Index(wildcard);
227 
228  const TString a = buffer(0, pos);
229  const TString b = buffer(pos+1, buffer.Length());
230 
231  buffer.ReplaceAll("[", "\\[");
232  buffer.ReplaceAll("]", "\\]");
233 
234  buffer.ReplaceAll(wildcard, ".*");
235 
236  const TRegexp regexp(buffer);
237 
238  TIter iter(in.GetListOfKeys());
239 
240  for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
241 
242  const TString tag(key->GetName());
243 
244  // option match
245 
246  if (tag.Index(regexp) != -1) {
247 
248  JValue_t* p = dynamic_cast<JValue_t*>(key->ReadObj());
249 
250  if (p != NULL) {
251 
252  resetObject(p, false);
253 
254  string buffer = p->GetName();
255 
256  if (a.Length() != 0) { buffer.replace(buffer.find(a), a.Length(), ""); }
257  if (b.Length() != 0) { buffer.replace(buffer.find(b), b.Length(), ""); }
258 
259  JKey_t key;
260 
261  istringstream(buffer) >> key;
262 
263  manager.insert(make_pair(key, p));
264  }
265  }
266  }
267 
268  return manager;
269  }
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
then echo Test string reversed by master(hit< return > to continue)." JProcess -c "JEcho" -rC fi if (( 1 ))
fi JEventTimesliceWriter a
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:42
bool resetObject(JManager< JKey_t, JValue_t > *object, const bool reset=false)
Reset JManager object.
Definition: JManager.hh:365
template<class JKey_t, class JValue_t>
void JGIZMO::JManager< JKey_t, JValue_t >::Read ( TDirectory &  in)
inline

Read objects from file.

Parameters
ininput file or directory

Definition at line 277 of file JManager.hh.

278  {
279  if (this->is_valid()) {
280 
281  JManager buffer = Read(in, this->get()->GetName(), this->wc);
282 
283  this->swap(buffer);
284  }
285  }
static JManager Read(TDirectory &in, const char *const master, const char wildcard)
Read objects from file into manager.
Definition: JManager.hh:217
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
bool is_valid() const
Check validity of pointer.
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:42
template<class JKey_t, class JValue_t>
void JGIZMO::JManager< JKey_t, JValue_t >::Write ( TDirectory &  out,
const bool  wm = false 
)
inline

Write objects to file.

Parameters
outoutput file or directory
wmwrite master

Definition at line 294 of file JManager.hh.

295  {
296  for (typename map_type::iterator i = this->begin(); i != this->end(); ++i) {
297  out.WriteTObject(i->second);
298  }
299 
300  if (wm) {
301  out.WriteTObject(this->get());
302  }
303  }
template<class JKey_t, class JValue_t>
void JGIZMO::JManager< JKey_t, JValue_t >::Write ( const char *  file_name,
const bool  wm = false 
)
inline

Write objects to file.

Parameters
file_namefile name
wmwrite master

Definition at line 312 of file JManager.hh.

313  {
314  TFile out(file_name, "RECREATE");
315 
316  this->Write(out, wm) ;
317 
318  out.Write();
319  out.Close();
320  }
void Write(TDirectory &out, const bool wm=false)
Write objects to file.
Definition: JManager.hh:294
template<class JClass_t>
virtual JClass_t* JLANG::JPointer< JClass_t >::get ( ) const
inlinevirtualinherited
template<class JClass_t>
virtual void JLANG::JPointer< JClass_t >::set ( JClass_t *  p)
inlinevirtualinherited

Set pointer.

Parameters
ppointer to object

Implements JLANG::JAbstractPointer< JClass_t >.

Reimplemented in JLANG::JSharedPointer< JClass_t, JMemory_t >, JLANG::JSharedPointer< JPHYSICS::JRadiation >, JLANG::JSharedPointer< JWeightEvent >, JLANG::JSharedPointer< JAccessibleObjectIterator< KM3NETDAQ::KM3NETDAQ::JDAQEvent > >, JLANG::JSharedPointer< const TFormula >, JLANG::JSharedPointer< JObjectIterator< T > >, JLANG::JSharedPointer< JFIT::JMEstimator >, JLANG::JSharedPointer< JAbstractAutoPointer< JBase_t > >, JLANG::JSharedPointer< JTRIGGER::JDAQHitSelector >, JLANG::JSharedPointer< JAccessibleObjectIterator< JNullType > >, JLANG::JSharedPointer< match_type >, JLANG::JSharedPointer< JAccessibleObjectIterator< JDAQSummaryslice > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JTypeList< JDAQEvent, JTypelist_t > > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JTail_t > >, JLANG::JSharedPointer< JLOGGER::JLogger >, JLANG::JSharedPointer< JAccessibleObjectIterator< T > >, JLANG::JSharedPointer< JParserElementInterface >, JLANG::JSharedPointer< JExceptionHandler >, JLANG::JSharedPointer< JObjectOutput< JHead_t > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JHead_t > >, JLANG::JSharedPointer< JRewindableObjectIterator< JTail_t > >, JLANG::JSharedPointer< JRewindableObjectIterator< JHead_t > >, JLANG::JSharedPointer< JObjectOutput< T > >, JLANG::JSharedPointer< JBase_t >, JLANG::JSharedPointer< JObjectOutput< JTail_t > >, JLANG::JSharedPointer< JPropertiesElementInterface >, JLANG::JSharedPointer< JTRIGGER::JMatch >, JLANG::JSharedPointer< JRewindableObjectIterator< const T > >, JLANG::JSharedPointer< JRewindableObjectIterator< T > >, JLANG::JSharedPointer< JAccessibleObjectOutput< T > >, JLANG::JSharedPointer< JNET::JControlHost >, and JLANG::JSharedPointer< JTOOLS::JMultiMapTransformer >.

Definition at line 75 of file JPointer.hh.

76  {
77  this->__p = p;
78  }
JClass_t * __p
pointer to object
Definition: JPointer.hh:136
template<class JClass_t>
template<class T >
void JLANG::JPointer< JClass_t >::set ( const JPointer< T > &  pointer)
inlineinherited

Set pointer.

Parameters
pointerpointer to object

Definition at line 96 of file JPointer.hh.

97  {
98  this->set(pointer.get());
99  }
virtual JClass_t * get() const
Get pointer.
Definition: JPointer.hh:64
virtual void set(JClass_t *p)
Set pointer.
Definition: JPointer.hh:75
template<class JClass_t>
virtual void JLANG::JPointer< JClass_t >::reset ( )
inlinevirtualinherited

Reset pointer.

Implements JLANG::JAbstractPointer< JClass_t >.

Reimplemented in JLANG::JSharedPointer< JClass_t, JMemory_t >, JLANG::JSharedPointer< JPHYSICS::JRadiation >, JLANG::JSharedPointer< JWeightEvent >, JLANG::JSharedPointer< JAccessibleObjectIterator< KM3NETDAQ::KM3NETDAQ::JDAQEvent > >, JLANG::JSharedPointer< const TFormula >, JLANG::JSharedPointer< JObjectIterator< T > >, JLANG::JSharedPointer< JFIT::JMEstimator >, JLANG::JSharedPointer< JAbstractAutoPointer< JBase_t > >, JLANG::JSharedPointer< JTRIGGER::JDAQHitSelector >, JLANG::JSharedPointer< JAccessibleObjectIterator< JNullType > >, JLANG::JSharedPointer< match_type >, JLANG::JSharedPointer< JAccessibleObjectIterator< JDAQSummaryslice > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JTypeList< JDAQEvent, JTypelist_t > > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JTail_t > >, JLANG::JSharedPointer< JLOGGER::JLogger >, JLANG::JSharedPointer< JAccessibleObjectIterator< T > >, JLANG::JSharedPointer< JParserElementInterface >, JLANG::JSharedPointer< JExceptionHandler >, JLANG::JSharedPointer< JObjectOutput< JHead_t > >, JLANG::JSharedPointer< JAccessibleObjectIterator< JHead_t > >, JLANG::JSharedPointer< JRewindableObjectIterator< JTail_t > >, JLANG::JSharedPointer< JRewindableObjectIterator< JHead_t > >, JLANG::JSharedPointer< JObjectOutput< T > >, JLANG::JSharedPointer< JBase_t >, JLANG::JSharedPointer< JObjectOutput< JTail_t > >, JLANG::JSharedPointer< JPropertiesElementInterface >, JLANG::JSharedPointer< JTRIGGER::JMatch >, JLANG::JSharedPointer< JRewindableObjectIterator< const T > >, JLANG::JSharedPointer< JRewindableObjectIterator< T > >, JLANG::JSharedPointer< JAccessibleObjectOutput< T > >, JLANG::JSharedPointer< JNET::JControlHost >, JLANG::JSharedPointer< JTOOLS::JMultiMapTransformer >, JLANG::JStorage< JClass_t, JMemory_t >, JLANG::JStorage< JDETECTOR::JK40Simulator, JNew >, JLANG::JStorage< JBuildL2_t, JNew >, JLANG::JStorage< JAccessibleObjectIterator< JTail_t >, JNew >, JLANG::JStorage< match_type, JNew >, JLANG::JStorage< JObjectOutput< JTail_t >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< JNullType >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< KM3NETDAQ::KM3NETDAQ::JDAQEvent >, JNew >, JLANG::JStorage< JDETECTOR::JCLBDefaultSimulatorInterface::JStateMachine, JNew >, JLANG::JStorage< JDETECTOR::JPMTSimulator, JNew >, JLANG::JStorage< JObjectIterator< T >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< T >, JNew >, JLANG::JStorage< JRewindableObjectIterator< JTail_t >, JNew >, JLANG::JStorage< JTOOLS::JFunction1D, JNew >, JLANG::JStorage< JDETECTOR::JCLBSimulator, JNew >, JLANG::JStorage< JModuleRouter, JNew >, JLANG::JStorage< JTOOLS::JMultiMapTransformer, JNew >, JLANG::JStorage< JTriggerNB, JNew >, JLANG::JStorage< JRewindableObjectIterator< const T >, JNew >, JLANG::JStorage< JBase_t, JNew >, JLANG::JStorage< const TFormula, JNew >, JLANG::JStorage< JWeightEvent, JNew >, JLANG::JStorage< JTrigger3DMuon, JNew >, JLANG::JStorage< JTrigger3DShower, JNew >, JLANG::JStorage< JParserElementInterface, JNew >, JLANG::JStorage< JFIT::JMEstimator, JNew >, JLANG::JStorage< JAbstractAutoPointer< JBase_t >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< JHead_t >, JNew >, JLANG::JStorage< JTRIGGER::JDAQHitSelector, JNew >, JLANG::JStorage< JTRIGGER::JMatch, JNew >, JLANG::JStorage< JPHYSICS::JRadiation, JNew >, JLANG::JStorage< JDETECTOR::JCLBDefaultSimulatorInterface::JTDC, JNew >, JLANG::JStorage< JLANG::JMultiPipe< T, N >, JNew >, JLANG::JStorage< JServerSocket, JNew >, JLANG::JStorage< JAccessibleObjectIterator< JDAQSummaryslice >, JNew >, JLANG::JStorage< JObjectOutput< JHead_t >, JNew >, JLANG::JStorage< JAccessibleObjectIterator< JTypeList< JDAQEvent, JTypelist_t > >, JNew >, JLANG::JStorage< JExceptionHandler, JNew >, JLANG::JStorage< TFile >, JLANG::JStorage< JTimesliceRouter, JNew >, JLANG::JStorage< JControlHost_t, JNew >, JLANG::JStorage< JRewindableObjectIterator< T >, JNew >, JLANG::JStorage< JPropertiesElementInterface, JNew >, JLANG::JStorage< JRewindableObjectIterator< JHead_t >, JNew >, JLANG::JStorage< JBuildL1_t, JNew >, JLANG::JStorage< JObjectOutput< T >, JNew >, JLANG::JStorage< JIO::JWriter, JNew >, JLANG::JStorage< JNET::JControlHost, JNew >, JLANG::JStorage< JAccessibleObjectOutput< T >, JNew >, JLANG::JStorage< JIO::JReader, JNew >, JLANG::JStorage< JLOGGER::JLogger, JNew >, and JLANG::JStorage< JTriggerMXShower, JNew >.

Definition at line 84 of file JPointer.hh.

85  {
86  this->__p = NULL;
87  }
JClass_t * __p
pointer to object
Definition: JPointer.hh:136
template<class JClass_t>
template<class T >
void JLANG::JPointer< JClass_t >::reset ( const JPointer< T > &  pointer)
inlineinherited

Reset pointer.

Parameters
pointerpointer to object

Definition at line 108 of file JPointer.hh.

109  {
110  this->reset(pointer.get());
111  }
virtual void reset()
Reset pointer.
Definition: JPointer.hh:84
virtual JClass_t * get() const
Get pointer.
Definition: JPointer.hh:64
template<class JClass_t>
void JLANG::JAbstractPointer< JClass_t >::reset ( JClass_t *  p)
inlineinherited

Reset pointer.

Parameters
ppointer to object

Definition at line 94 of file JAbstractPointer.hh.

95  {
96  if (this->get() != p) {
97 
98  this->reset();
99 
100  if (p != NULL) {
101  this->set(p);
102  }
103  }
104  }
virtual void reset()=0
Reset pointer.
virtual void set(JClass_t *p)=0
Set pointer.
template<class JClass_t>
JClass_t* const& JLANG::JPointer< JClass_t >::getReference ( ) const
inlineinherited

Get rereference to internal pointer.

Returns
reference to internal pointer

Definition at line 119 of file JPointer.hh.

120  {
121  return __p;
122  }
JClass_t * __p
pointer to object
Definition: JPointer.hh:136
template<class JClass_t>
JClass_t* & JLANG::JPointer< JClass_t >::getReference ( )
inlineinherited

Get rereference to internal pointer.

Returns
reference to internal pointer

Definition at line 130 of file JPointer.hh.

131  {
132  return __p;
133  }
JClass_t * __p
pointer to object
Definition: JPointer.hh:136
template<class JClass_t>
virtual bool JLANG::JAbstractPointer< JClass_t >::equals ( const JAbstractPointer< JClass_t > &  object) const
inlinevirtualinherited

Equals.

The equality is evaluated by comparison of the internal pointers.

Parameters
objectabstract pointer
Returns
true if equals; else false

Definition at line 50 of file JAbstractPointer.hh.

51  {
52  return this->get() == object.get();
53  }
template<class JClass_t>
bool JLANG::JAbstractPointer< JClass_t >::is_valid ( ) const
inlineinherited

Check validity of pointer.

Returns
true if pointer not null; else false

Definition at line 83 of file JAbstractPointer.hh.

84  {
85  return this->get() != NULL;
86  }
template<class JClass_t>
JClass_t* JLANG::JAbstractPointer< JClass_t >::operator-> ( ) const
inlineinherited

Smart pointer operator.

Returns
pointer to object

Definition at line 112 of file JAbstractPointer.hh.

113  {
114  if (!is_valid())
115  throw JNullPointerException("JAbstractPointer::operator->()");
116  else
117  return this->get();
118  }
bool is_valid() const
Check validity of pointer.
Exception for null pointer operation.
Definition: JException.hh:216
template<class JClass_t>
JLANG::JAbstractPointer< JClass_t >::operator JClass_t * ( ) const
inlineinherited

Type conversion operator.

Returns
pointer to object

Definition at line 126 of file JAbstractPointer.hh.

127  {
128  return this->get();
129  }

Friends And Related Function Documentation

template<class JKey_t, class JValue_t>
TFile& operator>> ( TFile &  file,
JManager< JKey_t, JValue_t > &  object 
)
friend

Read manager from file.

Parameters
filefile
objectmanager
Returns
file

Definition at line 330 of file JManager.hh.

331  {
332  object.Read(file);
333 
334  return file;
335  }
template<class JKey_t, class JValue_t>
TFile& operator<< ( TFile &  file,
JManager< JKey_t, JValue_t > &  object 
)
friend

Write manager to file.

Parameters
filefile
objectmanager
Returns
file

Definition at line 345 of file JManager.hh.

346  {
347  object.Write(file);
348 
349  return file;
350  }

Member Data Documentation

template<class JKey_t, class JValue_t>
char JGIZMO::JManager< JKey_t, JValue_t >::wc

Definition at line 352 of file JManager.hh.

template<class JKey_t, class JValue_t>
std::ios::fmtflags JGIZMO::JManager< JKey_t, JValue_t >::fmt

Definition at line 353 of file JManager.hh.

template<class JClass_t>
JClass_t* JLANG::JPointer< JClass_t >::__p
protectedinherited

pointer to object

Definition at line 136 of file JPointer.hh.


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