BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/TrkBase/include/TrkBase/AbsEvtObj.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: AbsEvtObj.h,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
4//
5// Description:
6// Class AbsEvtObj header file
7//
8// An AbsEvtObj is an abstract base class for holding common
9// method definitions for all objects in an AbsEvent
10//
11// The most important of these virtual methods is the destructor,
12// used to break dependencies on teh various class definitions
13//
14// Three forms of print are also declared.
15// stream << operator:
16// summarize object as a string, without using endl or newlines
17// print():
18// equivalent to the << operator
19// printAll():
20// output the entire contents of the object, using multiple
21// lines if needed. Should end with endl
22//
23// Environment:
24// Software developed for the BaBar Detector at the SLAC B-Factory.
25//
26// Author List:
27// Bob Jacobsen LBNL
28// Ed Frank University of Pennsylvania
29//
30// Copyright Information:
31// Copyright (C) 1995 LBNL
32//
33// History
34// ??xxx?? BobJ First versions
35// 02Feb97 Ed Frank Inherit from ProxyDict/DictData
36//
37// BUGS:
38// Any given object should have exactly one DictData base class.
39// There is a question of whether to make AbsEvtObj have DictData
40// as a public base or as a virtual public base. I've left it as
41// the former, thus leaving the design requirment of
42// "just one DictData base" as a responsibility of the user. I'm
43// not sure if this is the right thing to do. Comments are welcome.
44// If you are confused: the context is multiple inheritance
45// usage cases.
46//------------------------------------------------------------------------
47#ifndef ABSEVTOBJ_H
48#define ABSEVTOBJ_H
49// #include "BaBar/BaBar.hh"
50
51#include <assert.h>
52#include <iosfwd>
53// class AbsEvent;
54// class ToyCacheMgr;
55
56//
57// Class Definition
58//
59
60class AbsEvtObj {
61
62public:
63 virtual ~AbsEvtObj();
64
65 // There are three different print forms:
66 // 'print(cout)', used by and equivalent to <<, occupies exactly one line
67 virtual void print( std::ostream& o ) const;
68
69 // 'printAll(cout)', is allowed to take multiple lines and should
70 // dump entire contents
71 virtual void printAll( std::ostream& o ) const;
72
73 // used to setup any needed internal pointers for I/O
74 // right now, this is not used. Its intended as a post-load dbio setup.
75 // virtual void loadPtrs(const AbsEvent* ) {};
76 // virtual void savePtrs(const AbsEvent* ) {};
77
78 // This is a fix for ToyPrototype
79 // virtual void bindCacheMgr(ToyCacheMgr*) {};
80
81 // op == is needed so these can be held in Tools.h++ collections
82 inline bool operator==( const AbsEvtObj& a ) const { return this == &a; }
83
84protected:
85 // default constructor is protected to make it harder to
86 // instantiate by accident
87
89
90 // assignment operator protected to avoid use except by subclasses
91 AbsEvtObj& operator=( const AbsEvtObj& ) { return *this; };
92};
93
94// The third print form is the stand alone:
95std::ostream& operator<<( std::ostream& o, const AbsEvtObj& );
96
97#endif
std::ostream & operator<<(std::ostream &o, const AbsEvtObj &)
virtual ~AbsEvtObj()
virtual void printAll(std::ostream &o) const
virtual void print(std::ostream &o) const