Re: TTree::SetBranchAddressStatus protected?

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 6 Dec 2011 19:42:08 -0600


Hi Paul,

The enum is currently marked as private as it is not yet matured enough and documented enough (SetBranchAddress is due to a cleanup in the next or year and the enum will be published at that time.

Cheers,
Philippe.

On 12/4/11 8:00 AM, Paul Seyfert wrote:
> Dear rooters,
>
> so far I haven't used the return value of TTree::SetBranchAddress at all
> and let my code crash e.g. when a branch doesn't exist. For debuging
> reasons I just changed this. To keep the code readable I don't check
> whether the return value is some integer, but use the enum
> SetBranchAddressStatus:
>
> class myclass{
> private:
> TTree* m_tree;
> float m_branchvalue;
> public:
> TTree::SetBranchAddressStatus do_something();
> // something else
> };
>
> TTree::SetBranchAddressStatus myclass::do_something() {
> std::string branchname;
> //cryptic determination of the branch name
>
> return m_tree->SetBranchAddress(branchname.c_str(),&m_branchvalue);
> }
>
> int main() {
> myclass instance;
> if (TTree::kMatch == instance.do_something()) {
> // start working
> } else {
> // print some output which indicates what went wrong
> }
> return 0;
> }
>
> This however doesn't compile because the enum SetBranchAddressStatus is
> protected in TTree (in root 5.30/04).
>
> Is there a reason to keep it protected which I just don't see right now?
>
> Cheers,
> Paul
>
Received on Wed Dec 07 2011 - 02:42:17 CET

This archive was generated by hypermail 2.2.0 : Wed Dec 07 2011 - 11:50:02 CET