LDMX Software
|
The handle of a bus passenger. More...
Public Member Functions | |
virtual | ~Seat () |
Destructor. | |
virtual TBranch * | attach (TTree *tree, const std::string &branch_name, bool can_create)=0 |
Attach this passenger to the input tree. | |
virtual void | clear ()=0 |
Clear this passenger. | |
virtual void | stream (std::ostream &s) const =0 |
Define how we should stream the object to the input stream. | |
Friends | |
std::ostream & | operator<< (std::ostream &s, const std::unique_ptr< framework::Bus::Seat > &seat) |
Stream this object to the output stream. | |
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.
|
inlinevirtual |
|
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.
[in] | tree | pointer to TTree to attach to |
[in] | branch_name | name of branch we should attach to |
[in] | can_create | if true, we can create a new branch if we don't find one |
Implemented in framework::Bus::Passenger< BaggageType >.
|
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 framework::Bus::Passenger< BaggageType >.
|
pure virtual |
Define how we should stream the object to the input stream.
[in] | s | ostream to write to |
Implemented in framework::Bus::Passenger< BaggageType >.
|
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.
[in] | s | ostream to write to |
[in] | seat | Seat to write out |
Definition at line 238 of file Bus.h.