hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
Loading...
Searching...
No Matches
Bus::Seat Class Referenceabstract
Inheritance diagram for Bus::Seat:
Bus::Passenger< BaggageType >

Public Member Functions

virtual ~Seat ()
virtual TBranch * attach (TTree *tree, const std::string &branch_name, bool can_create)=0
virtual void clear ()=0
virtual void stream (std::ostream &s) const =0

Friends

std::ostream & operator<< (std::ostream &s, const std::unique_ptr< framework::Bus::Seat > &seat)

Detailed Description

The handle of a bus passenger

This is the foundation of the bus. Each bus passenger (which does know the type of object it is carrying) is given a seat on the bus that doesn't know the type of object it is carrying. This allows the bus to have one container for all the passengers carrying different types of objects and tell each of these objects to reset themselves at the end of the event.

Definition at line 198 of file Bus.h.

Constructor & Destructor Documentation

◆ ~Seat()

virtual ~Seat ( )
inlinevirtual

Destructor

Virtual so that the derived classes we will be pointing to with this class will be destructed when this is destructed.

Definition at line 206 of file Bus.h.

Member Function Documentation

◆ attach()

virtual TBranch * attach ( TTree * tree,
const std::string & branch_name,
bool can_create )
pure virtual

Attach this passenger to the input tree.

We don't define the attachement here, but this pure virtual function allows for us to make the attachment without knowledge of the type of object the derived class is storing.

Parameters
[in]treepointer to TTree to attach to
[in]branch_namename of branch we should attach to
[in]can_createif true, we can create a new branch if we don't find one
Returns
pointer to branch that we attached to (maybe be null if no branch found)

Implemented in Bus::Passenger< BaggageType >.

◆ clear()

virtual void clear ( )
pure virtual

Clear this passenger

Basically, we need to allow for this handle to reset the contents of the passenger because we won't know the type that is being stored when we wish to reset the event bus to an "undefined" state.

Implemented in Bus::Passenger< BaggageType >.

◆ stream()

virtual void stream ( std::ostream & s) const
pure virtual

Define how we should stream the object to the input stream.

Parameters
[in]sostream to write to

Implemented in Bus::Passenger< BaggageType >.

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const std::unique_ptr< framework::Bus::Seat > & seat )
friend

Stream this object to the output stream

Notice that the input Seat is a uniqe_ptr. This is because that is what is stored in the Bus.

May contain newlines if large object.

See also
stream for detailed implementation
Parameters
[in]sostream to write to
[in]seatSeat to write out
Returns
modified ostream

Definition at line 256 of file Bus.h.


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