Logo ROOT  
Reference Guide
ClassSelectionRule.h
Go to the documentation of this file.
1 
2 // @(#)root/core/utils:$Id: ClassSelectionRule.h 28529 2009-05-11 16:43:35Z pcanal $
3 // Author: Velislava Spasova September 2010
4 
5 /*************************************************************************
6  * Copyright (C) 1995-2011, Rene Brun, Fons Rademakers and al. *
7  * All rights reserved. *
8  * *
9  * For the licensing terms see $ROOTSYS/LICENSE. *
10  * For the list of contributors see $ROOTSYS/README/CREDITS. *
11  *************************************************************************/
12 
13 #ifndef R__CLASSSELECTIONRULE_H
14 #define R__CLASSSELECTIONRULE_H
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // ClassSelection //
19 // //
20 //////////////////////////////////////////////////////////////////////////
21 
22 #include "BaseSelectionRule.h"
23 #include "VariableSelectionRule.h"
24 
25 #include <list>
26 #include <iosfwd>
27 #include <string>
28 
29 namespace cling {
30  class Interpreter;
31 }
32 
34 {
35 private:
36  std::list<VariableSelectionRule> fFieldSelectionRules;
37  std::list<FunctionSelectionRule> fMethodSelectionRules;
39 
40  bool fRequestStreamerInfo; // for linkdef.h: true if we had '+' at the end of a class name
41  bool fRequestNoStreamer; // for linkdef.h: true if we had '-' or "-!" at the end of a class name
42  bool fRequestNoInputOperator; // for linkdef.h: true if we had '!' at the end of a class name
43  bool fRequestOnlyTClass; // True if the user want the TClass intiliazer but *not* the interpreter meta data
44  bool fRequestProtected; // Explicit request to be able to access protected member from the interpreter.
45  bool fRequestPrivate; // Explicit request to be able to access private member from the interpreter.
46  int fRequestedVersionNumber; // Explicit request for a specific version number (default to no request with -1).
47 
48 public:
49 
52 
53  ClassSelectionRule(long index, cling::Interpreter &interp, const char* selFileName = "", long lineno = -1):
54  BaseSelectionRule(index, interp, selFileName, lineno), fIsInheritable(false), fRequestStreamerInfo(false), fRequestNoStreamer(false), fRequestNoInputOperator(false), fRequestOnlyTClass(false), fRequestProtected(false), fRequestPrivate(false), fRequestedVersionNumber(-1) {}
55 
56  ClassSelectionRule(long index, bool inherit, ESelect sel, std::string attributeName, std::string attributeValue, cling::Interpreter &interp, const char* selFileName = "", long lineno = -1):
57  BaseSelectionRule(index, sel, attributeName, attributeValue, interp, selFileName, lineno), fIsInheritable(inherit), fRequestStreamerInfo(false), fRequestNoStreamer(false), fRequestNoInputOperator(false), fRequestOnlyTClass(false), fRequestProtected(false), fRequestPrivate(false), fRequestedVersionNumber(-1) {}
58 
59  void Print(std::ostream &out) const;
60 
61  void AddFieldSelectionRule(const VariableSelectionRule& field); //adds entry to the filed selections list
62  bool HasFieldSelectionRules() const;
63  //const std::list<VariableSelectionRule>& getFieldSelectionRules(); //gets the field selections list
64  const std::list<VariableSelectionRule>& GetFieldSelectionRules() const; //gets the field selections list
65 
66  void AddMethodSelectionRule(const FunctionSelectionRule& method); //adds entry to the method selections list
67  bool HasMethodSelectionRules() const;
68  //const std::list<FunctionSelectionRule>& getMethodSelectionRules(); //gets the method selections list
69  const std::list<FunctionSelectionRule>& GetMethodSelectionRules() const; //gets the method selections list
70 
71  bool IsInheritable() const; //checks if the class selection rule is inheritable
72  void SetInheritable(bool inherit); //sets the inheritance rule for the class
73 
74  void SetRequestStreamerInfo(bool needStreamerInfo);
75  void SetRequestNoStreamer(bool noStreamer);
76  void SetRequestNoInputOperator(bool excl);
77  void SetRequestOnlyTClass(bool val);
78  void SetRequestProtected(bool val);
79  void SetRequestPrivate(bool val);
80  void SetRequestedVersionNumber(int version);
81 
82  bool RequestOnlyTClass() const; // True if the user want the TClass intiliazer but *not* the interpreter meta data
83  bool RequestNoStreamer() const; // Request no Streamer function in the dictionary
84  bool RequestNoInputOperator() const; // Request no generation on a default input operator by rootcint or the compiler.
85  bool RequestStreamerInfo() const; // Request the ROOT 4+ I/O streamer
86  bool RequestProtected() const;
87  bool RequestPrivate() const;
88  int RequestedVersionNumber() const;
89 };
90 
91 #endif
92 
ClassSelectionRule::fRequestOnlyTClass
bool fRequestOnlyTClass
Definition: ClassSelectionRule.h:43
ClassSelectionRule::SetRequestedVersionNumber
void SetRequestedVersionNumber(int version)
Definition: ClassSelectionRule.cxx:155
ClassSelectionRule::SetRequestNoInputOperator
void SetRequestNoInputOperator(bool excl)
Definition: ClassSelectionRule.cxx:135
ClassSelectionRule::SetRequestOnlyTClass
void SetRequestOnlyTClass(bool val)
Definition: ClassSelectionRule.cxx:140
ClassSelectionRule::GetFieldSelectionRules
const std::list< VariableSelectionRule > & GetFieldSelectionRules() const
Definition: ClassSelectionRule.cxx:32
ClassSelectionRule::fMethodSelectionRules
std::list< FunctionSelectionRule > fMethodSelectionRules
Definition: ClassSelectionRule.h:37
ClassSelectionRule::SetInheritable
void SetInheritable(bool inherit)
Definition: ClassSelectionRule.cxx:105
ClassSelectionRule::fRequestStreamerInfo
bool fRequestStreamerInfo
Definition: ClassSelectionRule.h:40
ClassSelectionRule::fRequestNoInputOperator
bool fRequestNoInputOperator
Definition: ClassSelectionRule.h:42
BaseSelectionRule.h
ClassSelectionRule::RequestOnlyTClass
bool RequestOnlyTClass() const
Definition: ClassSelectionRule.cxx:160
ClassSelectionRule::fFieldSelectionRules
std::list< VariableSelectionRule > fFieldSelectionRules
Definition: ClassSelectionRule.h:36
ClassSelectionRule::RequestNoInputOperator
bool RequestNoInputOperator() const
Definition: ClassSelectionRule.cxx:130
ClassSelectionRule::fIsInheritable
bool fIsInheritable
Definition: ClassSelectionRule.h:38
ClassSelectionRule::GetMethodSelectionRules
const std::list< FunctionSelectionRule > & GetMethodSelectionRules() const
Definition: ClassSelectionRule.cxx:95
ClassSelectionRule::Print
void Print(std::ostream &out) const
Definition: ClassSelectionRule.cxx:47
ClassSelectionRule::SetRequestProtected
void SetRequestProtected(bool val)
Definition: ClassSelectionRule.cxx:145
ClassSelectionRule::SetRequestStreamerInfo
void SetRequestStreamerInfo(bool needStreamerInfo)
Definition: ClassSelectionRule.cxx:115
ClassSelectionRule::fRequestPrivate
bool fRequestPrivate
Definition: ClassSelectionRule.h:45
ClassSelectionRule::AddMethodSelectionRule
void AddMethodSelectionRule(const FunctionSelectionRule &method)
Definition: ClassSelectionRule.cxx:37
ClassSelectionRule::RequestPrivate
bool RequestPrivate() const
Definition: ClassSelectionRule.cxx:170
ClassSelectionRule::fRequestNoStreamer
bool fRequestNoStreamer
Definition: ClassSelectionRule.h:41
ClassSelectionRule::SetRequestPrivate
void SetRequestPrivate(bool val)
Definition: ClassSelectionRule.cxx:150
VariableSelectionRule
Definition: VariableSelectionRule.h:25
ClassSelectionRule::ClassSelectionRule
ClassSelectionRule(long index, cling::Interpreter &interp, const char *selFileName="", long lineno=-1)
Definition: ClassSelectionRule.h:53
ClassSelectionRule::HasFieldSelectionRules
bool HasFieldSelectionRules() const
Definition: ClassSelectionRule.cxx:26
ClassSelectionRule::RequestStreamerInfo
bool RequestStreamerInfo() const
Definition: ClassSelectionRule.cxx:110
ClassSelectionRule
Definition: ClassSelectionRule.h:33
ClassSelectionRule::ClassSelectionRule
ClassSelectionRule(ESelect sel=kYes)
Definition: ClassSelectionRule.h:50
BaseSelectionRule::kYes
@ kYes
Definition: BaseSelectionRule.h:44
ClassSelectionRule::IsInheritable
bool IsInheritable() const
Definition: ClassSelectionRule.cxx:100
BaseSelectionRule::ESelect
ESelect
Definition: BaseSelectionRule.h:43
ClassSelectionRule::RequestedVersionNumber
int RequestedVersionNumber() const
Definition: ClassSelectionRule.cxx:175
ClassSelectionRule::SetRequestNoStreamer
void SetRequestNoStreamer(bool noStreamer)
Definition: ClassSelectionRule.cxx:125
ClassSelectionRule::ClassSelectionRule
ClassSelectionRule(long index, bool inherit, ESelect sel, std::string attributeName, std::string attributeValue, cling::Interpreter &interp, const char *selFileName="", long lineno=-1)
Definition: ClassSelectionRule.h:56
ClassSelectionRule::fRequestProtected
bool fRequestProtected
Definition: ClassSelectionRule.h:44
ClassSelectionRule::RequestProtected
bool RequestProtected() const
Definition: ClassSelectionRule.cxx:165
ClassSelectionRule::fRequestedVersionNumber
int fRequestedVersionNumber
Definition: ClassSelectionRule.h:46
ClassSelectionRule::AddFieldSelectionRule
void AddFieldSelectionRule(const VariableSelectionRule &field)
Definition: ClassSelectionRule.cxx:21
ClassSelectionRule::HasMethodSelectionRules
bool HasMethodSelectionRules() const
Definition: ClassSelectionRule.cxx:42
VariableSelectionRule.h
BaseSelectionRule
Definition: BaseSelectionRule.h:38
ClassSelectionRule::RequestNoStreamer
bool RequestNoStreamer() const
Definition: ClassSelectionRule.cxx:120