ScopeBase.h

Go to the documentation of this file.
00001 // @(#)root/reflex:$Id: ScopeBase.h 36289 2010-10-11 09:54:28Z axel $
00002 // Author: Stefan Roiser 2004
00003 
00004 // Copyright CERN, CH-1211 Geneva 23, 2004-2010, All rights reserved.
00005 //
00006 // Permission to use, copy, modify, and distribute this software for any
00007 // purpose is hereby granted without fee, provided that this copyright and
00008 // permissions notice appear in all copies and derivatives.
00009 //
00010 // This software is provided "as is" without express or implied warranty.
00011 
00012 #ifndef Reflex_ScopeBase
00013 #define Reflex_ScopeBase
00014 
00015 // Include files
00016 #include "Reflex/Kernel.h"
00017 
00018 #ifndef Reflex_Scope
00019 #include "Reflex/Scope.h"
00020 #endif
00021 #include "Reflex/internal/OwnedPropertyList.h"
00022 #include "Reflex/internal/BuilderContainer.h"
00023 #include <vector>
00024 
00025 #ifdef _WIN32
00026 # pragma warning( push )
00027 # pragma warning( disable : 4251 )
00028 #endif
00029 
00030 namespace Reflex {
00031 // forward declarations
00032 class Scope;
00033 class ScopeName;
00034 class Namespace;
00035 class Class;
00036 class Member;
00037 class OwnedMember;
00038 class TypeTemplate;
00039 class MemberTemplate;
00040 class OwnedMemberTemplate;
00041 class Type;
00042 class DictionaryGenerator;
00043 class OnDemandBuilder;
00044 
00045 /**
00046  * @class ScopeBase ScopeBase.h Reflex/ScopeBase.h
00047  * @author Stefan Roiser
00048  * @date 24/11/2003
00049  * @ingroup Ref
00050  */
00051 class RFLX_API ScopeBase {
00052 public:
00053    enum EBuilderKind {
00054       kBuildDataMembers,
00055       kBuildFunctionMembers,
00056 
00057       kNumBuilderKinds
00058    };
00059 
00060    /** constructor within a At*/
00061    ScopeBase(const char* scope,
00062              TYPE scopeType);
00063 
00064 
00065    /** destructor */
00066    virtual ~ScopeBase();
00067 
00068 
00069    /**
00070     * operator Scope will return the corresponding Scope object
00071     * @return Scope corresponding to this ScopeBase
00072     */
00073    operator Scope() const;
00074 
00075 
00076    /**
00077     * the operator Type will return a corresponding Type object to the At if
00078     * applicable (i.e. if the Scope is also a Type e.g. Class, Union, Enum)
00079     */
00080    operator Type() const;
00081 
00082 
00083    /**
00084     * nthBase will return the nth BaseAt class information
00085     * @param  nth nth BaseAt class
00086     * @return pointer to BaseAt class information
00087     */
00088    virtual Base BaseAt(size_t nth) const;
00089 
00090 
00091    /**
00092     * BaseSize will return the number of BaseAt classes
00093     * @return number of BaseAt classes
00094     */
00095    virtual size_t BaseSize() const;
00096 
00097 
00098    virtual Base_Iterator Base_Begin() const;
00099    virtual Base_Iterator Base_End() const;
00100    virtual Reverse_Base_Iterator Base_RBegin() const;
00101    virtual Reverse_Base_Iterator Base_REnd() const;
00102 
00103 
00104    /**
00105     * nthDataMember will return the nth data MemberAt of the At
00106     * @param  nth data MemberAt
00107     * @return pointer to data MemberAt
00108     */
00109    virtual Member DataMemberAt(size_t nth,
00110                                EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00111 
00112 
00113    /**
00114     * DataMemberByName will return the MemberAt with Name
00115     * @param  Name of data MemberAt
00116     * @return data MemberAt
00117     */
00118    virtual Member DataMemberByName(const std::string& nam,
00119                                    EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00120 
00121 
00122    /**
00123     * DataMemberSize will return the number of data members of this At
00124     * @return number of data members
00125     */
00126    virtual size_t DataMemberSize(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00127 
00128 
00129    virtual Member_Iterator DataMember_Begin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00130    virtual Member_Iterator DataMember_End(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00131    virtual Reverse_Member_Iterator DataMember_RBegin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00132    virtual Reverse_Member_Iterator DataMember_REnd(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00133 
00134 
00135    /**
00136     * DeclaringScope will return a pointer to the At of this one
00137     * @return pointer to declaring At
00138     */
00139    virtual Scope DeclaringScope() const;
00140 
00141 
00142    /**
00143     * nthFunctionMember will return the nth function MemberAt of the At
00144     * @param  nth function MemberAt
00145     * @return pointer to function MemberAt
00146     */
00147    virtual Member FunctionMemberAt(size_t nth,
00148                                    EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00149 
00150 
00151    /**
00152     * FunctionMemberByName will return the MemberAt with the Name,
00153     * optionally the signature of the function may be given
00154     * @param  Name of function MemberAt
00155     * @param  signature of the MemberAt function
00156     * @modifiers_mask When matching, do not compare the listed modifiers
00157     * @return function MemberAt
00158     */
00159    virtual Member FunctionMemberByName(const std::string& name,
00160                                        const Type& signature,
00161                                        unsigned int modifiers_mask = 0,
00162                                        EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT,
00163                                        EDELAYEDLOADSETTING allowDelayedLoad = DELAYEDLOAD_ON) const;
00164 
00165 
00166    /**
00167     * FunctionMemberByNameAndSignature will return the MemberAt with the Name,
00168     * optionally the signature of the function may be given
00169     * @param  Name of function MemberAt
00170     * @param  signature of the MemberAt function
00171     * @modifiers_mask When matching, do not compare the listed modifiers
00172     * @return function MemberAt
00173     */
00174    virtual Member FunctionMemberByNameAndSignature(const std::string& name,
00175                                                    const Type& signature,
00176                                                    unsigned int modifiers_mask = 0,
00177                                                    EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT,
00178                                                    EDELAYEDLOADSETTING allowDelayedLoad = DELAYEDLOAD_ON) const;
00179 
00180 
00181    /**
00182     * FunctionMemberSize will return the number of function members of
00183     * this type
00184     * @return number of function members
00185     */
00186    virtual size_t FunctionMemberSize(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00187 
00188 
00189    virtual Member_Iterator FunctionMember_Begin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00190    virtual Member_Iterator FunctionMember_End(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00191    virtual Reverse_Member_Iterator FunctionMember_RBegin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00192    virtual Reverse_Member_Iterator FunctionMember_REnd(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00193 
00194 
00195    /**
00196     * GenerateDict will produce the dictionary information of this type
00197     * @param generator a reference to the dictionary generator instance
00198     */
00199    virtual void GenerateDict(DictionaryGenerator& generator) const;
00200 
00201 
00202    /**
00203     * GetBasePosition will return fBasePosition
00204     * @return The position where the unscoped Name starts in the typename
00205     */
00206    size_t GetBasePosition() const;
00207 
00208 
00209    /**
00210     * GlobalScope will return the global scope representation\
00211     * @return global scope
00212     */
00213    static Scope GlobalScope();
00214 
00215 
00216    /**
00217     * HasBase will check whether this class has a base class given
00218     * as argument
00219     * @param  cl the base-class to check for
00220     * @return the Base info if it is found, an empty base otherwise (can be tested for bool)
00221     */
00222    virtual bool HasBase(const Type& cl) const;
00223 
00224 
00225    /**
00226     * IsClass returns true if the At represents a Class
00227     * @return true if At represents a Class
00228     */
00229    bool IsClass() const;
00230 
00231 
00232    /**
00233     * IsEnum returns true if the At represents a Enum
00234     * @return true if At represents a Enum
00235     */
00236    bool IsEnum() const;
00237 
00238 
00239    /**
00240     * IsNamespace returns true if the At represents a Namespace
00241     * @return true if At represents a Namespace
00242     */
00243    bool IsNamespace() const;
00244 
00245 
00246    /**
00247     * IsTemplateInstance returns true if the At represents a
00248     * ClassTemplateInstance
00249     * @return true if At represents a InstantiatedTemplateClass
00250     */
00251    bool IsTemplateInstance() const;
00252 
00253 
00254    /**
00255     * IsTopScope will return true if the current At is the top
00256     * (Empty) namespace
00257     * @return true if current sope is top namespace
00258     */
00259    bool IsTopScope() const;
00260 
00261 
00262    /**
00263     * IsUnion returns true if the At represents a Union
00264     * @return true if At represents a
00265     */
00266    bool IsUnion() const;
00267 
00268 
00269    /**
00270     * LookupMember will lookup a member in the current scope
00271     * @param nam the string representation of the member to lookup
00272     * @param current the current scope
00273     * @return if a matching member is found return it, otherwise return empty member
00274     */
00275    Member LookupMember(const std::string& nam,
00276                        const Scope& current) const;
00277 
00278 
00279    /**
00280     * LookupType will lookup a type in the current scope
00281     * @param nam the string representation of the type to lookup
00282     * @param current the current scope
00283     * @return if a matching type is found return it, otherwise return empty type
00284     */
00285    Type LookupType(const std::string& nam,
00286                    const Scope& current) const;
00287 
00288 
00289    /**
00290     * LookupType will lookup a scope in the current scope
00291     * @param nam the string representation of the scope to lookup
00292     * @param current the current scope
00293     * @return if a matching scope is found return it, otherwise return empty scope
00294     */
00295    Scope LookupScope(const std::string& nam,
00296                      const Scope& current) const;
00297 
00298 
00299    /**
00300     * MemberByName will return the first MemberAt with a given Name
00301     * @param Name  MemberAt Name
00302     * @return pointer to MemberAt
00303     */
00304    virtual Member MemberByName(const std::string& name,
00305                                const Type& signature,
00306                                EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00307 
00308 
00309    /**
00310     * MemberAt will return the nth MemberAt of the At
00311     * @param  nth MemberAt
00312     * @return pointer to nth MemberAt
00313     */
00314    virtual Member MemberAt(size_t nth,
00315                            EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00316 
00317 
00318    virtual Member_Iterator Member_Begin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00319    virtual Member_Iterator Member_End(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00320    virtual Reverse_Member_Iterator Member_RBegin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00321    virtual Reverse_Member_Iterator Member_REnd(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00322 
00323 
00324    /**
00325     * MemberSize will return the number of members
00326     * @return number of members
00327     */
00328    virtual size_t MemberSize(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00329 
00330 
00331    /**
00332     * MemberTemplateAt will return the nth MemberAt template of this At
00333     * @param nth MemberAt template
00334     * @return nth MemberAt template
00335     */
00336    MemberTemplate MemberTemplateAt(size_t nth) const;
00337 
00338 
00339    /**
00340     * MemberTemplateSize will return the number of MemberAt templates in this socpe
00341     * @return number of defined MemberAt templates
00342     */
00343    size_t MemberTemplateSize() const;
00344 
00345 
00346    /**
00347     * MemberTemplateByName will return the member template representation in this
00348     * scope
00349     * @param string representing the member template to look for
00350     * @return member template representation of the looked up member
00351     */
00352    MemberTemplate MemberTemplateByName(const std::string& nam) const;
00353 
00354 
00355    MemberTemplate_Iterator MemberTemplate_Begin() const;
00356    MemberTemplate_Iterator MemberTemplate_End() const;
00357    Reverse_MemberTemplate_Iterator MemberTemplate_RBegin() const;
00358    Reverse_MemberTemplate_Iterator MemberTemplate_REnd() const;
00359 
00360 
00361    /**
00362     * Name will return the Name of the At
00363     * @return Name of At
00364     */
00365    virtual std::string Name(unsigned int mod = 0) const;
00366 
00367 
00368    /**
00369     * SimpleName returns the name of the type as a reference. It provides a
00370     * simplified but faster generation of a type name. Attention currently it
00371     * is not guaranteed that Name() and SimpleName() return the same character
00372     * layout of a name (ie. spacing, commas, etc. )
00373     * @param pos will indicate where in the returned reference the requested name starts
00374     * @param mod The only 'mod' support is SCOPED
00375     * @return name of type
00376     */
00377    virtual const char* SimpleName(size_t& pos,
00378                                   unsigned int mod = 0) const;
00379 
00380 
00381    /**
00382     * Properties will return a pointer to the PropertyNth list attached
00383     * to this item
00384     * @return pointer to PropertyNth list
00385     */
00386    virtual PropertyList Properties() const;
00387 
00388 
00389    /**
00390     * At will return the At Object of this ScopeBase
00391     * @return corresponding Scope
00392     */
00393    Scope ThisScope() const;
00394 
00395 
00396    /**
00397     * ScopeType will return which kind of At is represented
00398     * @return At of At
00399     */
00400    TYPE ScopeType() const;
00401 
00402 
00403    /**
00404     * ScopeTypeAsString will return the string representation of the enum
00405     * representing the current Scope (e.g. "CLASS")
00406     * @return string representation of enum for Scope
00407     */
00408    std::string ScopeTypeAsString() const;
00409 
00410 
00411    /**
00412     * SubScopeAt will return a pointer to a sub-scopes
00413     * @param  nth sub-At
00414     * @return pointer to nth sub-At
00415     */
00416    Scope SubScopeAt(size_t nth) const;
00417 
00418 
00419    /**
00420     * SubScopeLevel will return the number of declaring scopes
00421     * this scope lives in.
00422     * @return number of declaring scopes above this scope.
00423     */
00424    size_t SubScopeLevel() const;
00425 
00426 
00427    /**
00428     * ScopeSize will return the number of sub-scopes
00429     * @return number of sub-scopes
00430     */
00431    size_t SubScopeSize() const;
00432 
00433 
00434    /**
00435     * SubScopeByName will return a sub scope representing the unscoped name passed
00436     * as argument
00437     * @param unscoped name of the sub scope to look for
00438     * @return Scope representation of the sub scope
00439     */
00440    Scope SubScopeByName(const std::string& nam) const;
00441 
00442 
00443    Scope_Iterator SubScope_Begin() const;
00444    Scope_Iterator SubScope_End() const;
00445    Reverse_Scope_Iterator SubScope_RBegin() const;
00446    Reverse_Scope_Iterator SubScope_REnd() const;
00447 
00448 
00449    /**
00450     * At will return a pointer to the nth sub-At
00451     * @param  nth sub-At
00452     * @return pointer to nth sub-At
00453     */
00454    Type SubTypeAt(size_t nth) const;
00455 
00456 
00457    /**
00458     * TypeSize will returnt he number of sub-types
00459     * @return number of sub-types
00460     */
00461    size_t SubTypeSize() const;
00462 
00463 
00464    /**
00465     * SubTypeByName will return the Type representing the sub type
00466     * @param string of the unscoped sub type to look for
00467     * @return Type representation of the sub type
00468     */
00469    Type SubTypeByName(const std::string& nam) const;
00470 
00471 
00472    Type_Iterator SubType_Begin() const;
00473    Type_Iterator SubType_End() const;
00474    Reverse_Type_Iterator SubType_RBegin() const;
00475    Reverse_Type_Iterator SubType_REnd() const;
00476 
00477 
00478    /**
00479     * SubTypeTemplateAt will return the nth At template of this At
00480     * @param  nth sub type template
00481     * @return nth sub type template
00482     */
00483    TypeTemplate SubTypeTemplateAt(size_t nth) const;
00484 
00485 
00486    /**
00487     * SubTypeTemplateSize will return the number of At templates in this socpe
00488     * @return number of defined sub type templates
00489     */
00490    size_t SubTypeTemplateSize() const;
00491 
00492 
00493    /**
00494     * SubTypeTemplateByName will return a type template defined in this scope looked up by
00495     * it's unscoped name
00496     * @param unscoped name of the type template to look for
00497     * @return TypeTemplate representation of the sub type template
00498     */
00499    TypeTemplate SubTypeTemplateByName(const std::string& nam) const;
00500 
00501 
00502    TypeTemplate_Iterator SubTypeTemplate_Begin() const;
00503    TypeTemplate_Iterator SubTypeTemplate_End() const;
00504    Reverse_TypeTemplate_Iterator SubTypeTemplate_RBegin() const;
00505    Reverse_TypeTemplate_Iterator SubTypeTemplate_REnd() const;
00506 
00507 
00508    /**
00509     * UsingDirectiveAt will return the nth using directive
00510     * @param  nth using directive
00511     * @return nth using directive
00512     */
00513    Scope UsingDirectiveAt(size_t nth) const;
00514 
00515 
00516    /**
00517     * UsingDirectiveSize will return the number of using directives of this scope
00518     * @return number of using directives declared in this scope
00519     */
00520    size_t UsingDirectiveSize() const;
00521 
00522 
00523    Scope_Iterator UsingDirective_Begin() const;
00524    Scope_Iterator UsingDirective_End() const;
00525    Reverse_Scope_Iterator UsingDirective_RBegin() const;
00526    Reverse_Scope_Iterator UsingDirective_REnd() const;
00527 
00528 protected:
00529    /** protected constructor for initialisation of the global namespace */
00530    ScopeBase();
00531 
00532 public:
00533    /**
00534     * AddBase will add information about a Base class
00535     * @param base type of the base class
00536     * @param offsFP pointer to a function stub for calculating the base class offset
00537     * @param modifiers the modifiers of the base class
00538     */
00539    virtual void AddBase(const Type& bas,
00540                         OffsetFunction offsFP,
00541                         unsigned int modifiers = 0) const;
00542 
00543 
00544    /**
00545     * AddBase will add the information about a Base class
00546     * @param b pointer to the base class
00547     */
00548    virtual void AddBase(const Base& b) const;
00549 
00550 
00551    /**
00552     * AddDataMember will add the information about a data MemberAt
00553     * @param dm pointer to data MemberAt
00554     */
00555    virtual void AddDataMember(const Member& dm) const;
00556    virtual Member AddDataMember(const char* name,
00557                                 const Type& type,
00558                                 size_t offset,
00559                                 unsigned int modifiers = 0,
00560                                 char* interpreterOffset = 0) const;
00561 
00562 
00563    /**
00564     * AddFunctionMember will add the information about a function MemberAt
00565     * @param fm pointer to function MemberAt
00566     */
00567    virtual void AddFunctionMember(const Member& fm) const;
00568    virtual Member AddFunctionMember(const char* name,
00569                                     const Type& type,
00570                                     StubFunction stubFP,
00571                                     void* stubCtx = 0,
00572                                     const char* params = 0,
00573                                     unsigned int modifiers = 0) const;
00574 
00575 
00576    virtual void AddMemberTemplate(const MemberTemplate& mt) const;
00577 
00578 
00579    /**
00580     * AddSubScope will add a sub-At to this one
00581     * @param sc pointer to Scope
00582     */
00583    virtual void AddSubScope(const Scope& sc) const;
00584    virtual void AddSubScope(const char* scope,
00585                             TYPE scopeType) const;
00586 
00587 
00588    /**
00589     * AddSubType will add a sub-At to this At
00590     * @param sc pointer to Type
00591     */
00592    virtual void AddSubType(const Type& ty) const;
00593    virtual void AddSubType(const char* type,
00594                            size_t size,
00595                            TYPE typeType,
00596                            const std::type_info& ti,
00597                            unsigned int modifiers = 0) const;
00598 
00599 
00600    void AddSubTypeTemplate(const TypeTemplate& tt) const;
00601 
00602 
00603    void AddUsingDirective(const Scope& ud) const;
00604 
00605 
00606    /**
00607     * RemoveDataMember will remove the information about a data MemberAt
00608     * @param dm pointer to data MemberAt
00609     */
00610    virtual void RemoveDataMember(const Member& dm) const;
00611 
00612 
00613    /**
00614     * RemoveFunctionMember will remove the information about a function MemberAt
00615     * @param fm pointer to function MemberAt
00616     */
00617    virtual void RemoveFunctionMember(const Member& fm) const;
00618 
00619 
00620    virtual void RemoveMemberTemplate(const MemberTemplate& mt) const;
00621 
00622 
00623    /**
00624     * RemoveSubScope will remove a sub-At to this one
00625     * @param sc pointer to Scope
00626     */
00627    virtual void RemoveSubScope(const Scope& sc) const;
00628 
00629 
00630    /**
00631     * RemoveSubType will remove a sub-At to this At
00632     * @param sc pointer to Type
00633     */
00634    virtual void RemoveSubType(const Type& ty) const;
00635 
00636 
00637    virtual void RemoveSubTypeTemplate(const TypeTemplate& tt) const;
00638 
00639 
00640    void RemoveUsingDirective(const Scope& ud) const;
00641 
00642 
00643    /**
00644     * Hide this scope from any lookup by appending the string " @HIDDEN@" to its name.
00645     */
00646    virtual void HideName() const;
00647 
00648    /**
00649     * Un-Hide this scope from any lookup by removing the string " @HIDDEN@" to its name.
00650     */
00651    virtual void UnhideName() const;
00652 
00653    /** Initialize the vector of inherited members.
00654        Returns false if one of the bases is not complete. */
00655    virtual bool UpdateMembers() const;
00656 
00657    void RegisterOnDemandBuilder(OnDemandBuilder* builder,
00658                                 EBuilderKind kind);
00659 
00660 protected:
00661    /** The MemberByName work-horse: find a member called name in members,
00662        if signature also compare its signature, and if matchReturnType
00663        also compare the signature's return types. */
00664    Member MemberByName2(const std::vector<Member>& members,
00665                         const std::string& name,
00666                         const Type* signature = 0,
00667                         unsigned int modifiers_mask = 0,
00668                         bool matchReturnType = true) const;
00669 
00670 
00671    void ExecuteFunctionMemberDelayLoad() const {
00672       if (!fOnDemandBuilder[kBuildFunctionMembers].Empty())
00673          fOnDemandBuilder[kBuildFunctionMembers].BuildAll();
00674    }
00675 
00676    void ExecuteDataMemberDelayLoad() const {
00677       if (!fOnDemandBuilder[kBuildDataMembers].Empty())
00678          fOnDemandBuilder[kBuildDataMembers].BuildAll();
00679    }
00680 
00681 private:
00682    /* no copying */
00683    ScopeBase(const ScopeBase &);
00684 
00685    /* no assignment */
00686    ScopeBase& operator =(const ScopeBase&);
00687 
00688 protected:
00689    /** container for all members of the Scope */
00690    typedef std::vector<Member> Members;
00691    typedef std::vector<OwnedMember> OMembers;
00692 
00693    /**
00694     * pointers to members
00695     * @label scope members
00696     * @link aggregationByValue
00697     * @supplierCardinality 0..*
00698     * @clientCardinality 1
00699     */
00700    mutable
00701    std::vector<OwnedMember> fMembers;
00702 
00703    /**
00704     * container with pointers to all data members in this scope
00705     * @label scope datamembers
00706     * @link aggregation
00707     * @clientCardinality 1
00708     * @supplierCardinality 0..*
00709     */
00710    mutable
00711    std::vector<Member> fDataMembers;
00712 
00713    /**
00714     * container with pointers to all function members in this scope
00715     * @label scope functionmembers
00716     * @link aggregation
00717     * @supplierCardinality 0..*
00718     * @clientCardinality 1
00719     */
00720    mutable
00721    std::vector<Member> fFunctionMembers;
00722 
00723 private:
00724    /**
00725     * pointer to the Scope Name
00726     * @label scope name
00727     * @link aggregation
00728     * @clientCardinality 1
00729     * @supplierCardinality 1
00730     */
00731    ScopeName* fScopeName;
00732 
00733 
00734    /**
00735     * Type of the scope
00736     * @link aggregation
00737     * @label scope type
00738     * @clientCardinality 1
00739     * @supplierCardinality 1
00740     */
00741    TYPE fScopeType;
00742 
00743 
00744    /**
00745     * pointer to declaring Scope
00746     * @label declaring scope
00747     * @link aggregation
00748     * @clientCardinality 1
00749     * @supplierCardinality 1
00750     */
00751    Scope fDeclaringScope;
00752 
00753 
00754    /**
00755     * pointers to sub-scopes
00756     * @label sub scopes
00757     * @link aggregation
00758     * @supplierCardinality 0..*
00759     * @clientCardinality 1
00760     */
00761    mutable
00762    std::vector<Scope> fSubScopes;
00763 
00764 
00765    /**
00766     * pointer to types
00767     * @label sub types
00768     * @link aggregation
00769     * @supplierCardinality 0..*
00770     * @clientCardinality 1
00771     */
00772    mutable
00773    std::vector<Type> fSubTypes;
00774 
00775 
00776    /**
00777     * container for type templates defined in this scope
00778     * @label type templates
00779     * @link aggregation
00780     * @supplierCardinality 0..*
00781     * @clientCardinality 1
00782     */
00783    mutable
00784    std::vector<TypeTemplate> fTypeTemplates;
00785 
00786 
00787    /**
00788     * container for member templates defined in this scope
00789     * @label member templates
00790     * @link aggregation
00791     * @supplierCardinality 0..*
00792     * @clientCardinality 1
00793     */
00794    mutable
00795    std::vector<OwnedMemberTemplate> fMemberTemplates;
00796 
00797 
00798    /**
00799     * container for using directives of this scope
00800     * @label using directives
00801     * @linkScope aggregation
00802     * @supplierCardinality 0..*
00803     * @clientCardinality 1
00804     */
00805    mutable
00806    std::vector<Scope> fUsingDirectives;
00807 
00808 
00809    /**
00810     * The position where the unscoped Name starts in the scopename
00811     */
00812    size_t fBasePosition;
00813 
00814    /**
00815     * Containers for on-demand builders of function and data members.
00816     */
00817    mutable
00818    BuilderContainer fOnDemandBuilder[kNumBuilderKinds];
00819 
00820 };    // class ScopeBase
00821 } //namespace Reflex
00822 
00823 
00824 //-------------------------------------------------------------------------------
00825 inline size_t
00826 Reflex::ScopeBase::BaseSize() const {
00827 //-------------------------------------------------------------------------------
00828    return 0;
00829 }
00830 
00831 
00832 //-------------------------------------------------------------------------------
00833 inline Reflex::Base_Iterator
00834 Reflex::ScopeBase::Base_Begin() const {
00835 //-------------------------------------------------------------------------------
00836    return Dummy::BaseCont().begin();
00837 }
00838 
00839 
00840 //-------------------------------------------------------------------------------
00841 inline Reflex::Base_Iterator
00842 Reflex::ScopeBase::Base_End() const {
00843 //-------------------------------------------------------------------------------
00844    return Dummy::BaseCont().end();
00845 }
00846 
00847 
00848 //-------------------------------------------------------------------------------
00849 inline Reflex::Reverse_Base_Iterator
00850 Reflex::ScopeBase::Base_RBegin() const {
00851 //-------------------------------------------------------------------------------
00852    return Dummy::BaseCont().rbegin();
00853 }
00854 
00855 
00856 //-------------------------------------------------------------------------------
00857 inline Reflex::Reverse_Base_Iterator
00858 Reflex::ScopeBase::Base_REnd() const {
00859 //-------------------------------------------------------------------------------
00860    return Dummy::BaseCont().rend();
00861 }
00862 
00863 
00864 //-------------------------------------------------------------------------------
00865 inline Reflex::Scope
00866 Reflex::ScopeBase::DeclaringScope() const {
00867 //-------------------------------------------------------------------------------
00868    return fDeclaringScope;
00869 }
00870 
00871 
00872 //-------------------------------------------------------------------------------
00873 inline Reflex::Member_Iterator
00874 Reflex::ScopeBase::DataMember_Begin(EMEMBERQUERY) const {
00875 //-------------------------------------------------------------------------------
00876    ExecuteDataMemberDelayLoad();
00877    return fDataMembers.begin();
00878 }
00879 
00880 
00881 //-------------------------------------------------------------------------------
00882 inline Reflex::Member_Iterator
00883 Reflex::ScopeBase::DataMember_End(EMEMBERQUERY) const {
00884 //-------------------------------------------------------------------------------
00885    ExecuteDataMemberDelayLoad();
00886    return fDataMembers.end();
00887 }
00888 
00889 
00890 //-------------------------------------------------------------------------------
00891 inline Reflex::Reverse_Member_Iterator
00892 Reflex::ScopeBase::DataMember_RBegin(EMEMBERQUERY) const {
00893 //-------------------------------------------------------------------------------
00894    ExecuteDataMemberDelayLoad();
00895    return ((const std::vector<Member> &)fDataMembers).rbegin();
00896 }
00897 
00898 
00899 //-------------------------------------------------------------------------------
00900 inline Reflex::Reverse_Member_Iterator
00901 Reflex::ScopeBase::DataMember_REnd(EMEMBERQUERY) const {
00902 //-------------------------------------------------------------------------------
00903    ExecuteDataMemberDelayLoad();
00904    return ((const std::vector<Member> &)fDataMembers).rend();
00905 }
00906 
00907 
00908 //-------------------------------------------------------------------------------
00909 inline Reflex::Member_Iterator
00910 Reflex::ScopeBase::FunctionMember_Begin(EMEMBERQUERY) const {
00911 //-------------------------------------------------------------------------------
00912    ExecuteFunctionMemberDelayLoad();
00913    return fFunctionMembers.begin();
00914 }
00915 
00916 
00917 //-------------------------------------------------------------------------------
00918 inline Reflex::Member_Iterator
00919 Reflex::ScopeBase::FunctionMember_End(EMEMBERQUERY) const {
00920 //-------------------------------------------------------------------------------
00921    ExecuteFunctionMemberDelayLoad();
00922    return fFunctionMembers.end();
00923 }
00924 
00925 
00926 //-------------------------------------------------------------------------------
00927 inline Reflex::Reverse_Member_Iterator
00928 Reflex::ScopeBase::FunctionMember_RBegin(EMEMBERQUERY) const {
00929 //-------------------------------------------------------------------------------
00930    ExecuteFunctionMemberDelayLoad();
00931    return ((const std::vector<Member> &)fFunctionMembers).rbegin();
00932 }
00933 
00934 
00935 //-------------------------------------------------------------------------------
00936 inline Reflex::Reverse_Member_Iterator
00937 Reflex::ScopeBase::FunctionMember_REnd(EMEMBERQUERY) const {
00938 //-------------------------------------------------------------------------------
00939    ExecuteFunctionMemberDelayLoad();
00940    return ((const std::vector<Member> &)fFunctionMembers).rend();
00941 }
00942 
00943 
00944 //-------------------------------------------------------------------------------
00945 inline size_t
00946 Reflex::ScopeBase::GetBasePosition() const {
00947 //-------------------------------------------------------------------------------
00948    return fBasePosition;
00949 }
00950 
00951 
00952 //-------------------------------------------------------------------------------
00953 inline Reflex::Scope_Iterator
00954 Reflex::ScopeBase::SubScope_Begin() const {
00955 //-------------------------------------------------------------------------------
00956    return fSubScopes.begin();
00957 }
00958 
00959 
00960 //-------------------------------------------------------------------------------
00961 inline Reflex::Scope_Iterator
00962 Reflex::ScopeBase::SubScope_End() const {
00963 //-------------------------------------------------------------------------------
00964    return fSubScopes.end();
00965 }
00966 
00967 
00968 //-------------------------------------------------------------------------------
00969 inline Reflex::Reverse_Scope_Iterator
00970 Reflex::ScopeBase::SubScope_RBegin() const {
00971 //-------------------------------------------------------------------------------
00972    return ((const std::vector<Scope> &)fSubScopes).rbegin();
00973 }
00974 
00975 
00976 //-------------------------------------------------------------------------------
00977 inline Reflex::Reverse_Scope_Iterator
00978 Reflex::ScopeBase::SubScope_REnd() const {
00979 //-------------------------------------------------------------------------------
00980    return ((const std::vector<Scope> &)fSubScopes).rend();
00981 }
00982 
00983 
00984 //-------------------------------------------------------------------------------
00985 inline Reflex::Type_Iterator
00986 Reflex::ScopeBase::SubType_Begin() const {
00987 //-------------------------------------------------------------------------------
00988    return fSubTypes.begin();
00989 }
00990 
00991 
00992 //-------------------------------------------------------------------------------
00993 inline Reflex::Type_Iterator
00994 Reflex::ScopeBase::SubType_End() const {
00995 //-------------------------------------------------------------------------------
00996    return fSubTypes.end();
00997 }
00998 
00999 
01000 //-------------------------------------------------------------------------------
01001 inline Reflex::Reverse_Type_Iterator
01002 Reflex::ScopeBase::SubType_RBegin() const {
01003 //-------------------------------------------------------------------------------
01004    return ((const std::vector<Type> &)fSubTypes).rbegin();
01005 }
01006 
01007 
01008 //-------------------------------------------------------------------------------
01009 inline Reflex::Reverse_Type_Iterator
01010 Reflex::ScopeBase::SubType_REnd() const {
01011 //-------------------------------------------------------------------------------
01012    return ((const std::vector<Type> &)fSubTypes).rend();
01013 }
01014 
01015 
01016 //-------------------------------------------------------------------------------
01017 inline Reflex::TypeTemplate_Iterator
01018 Reflex::ScopeBase::SubTypeTemplate_Begin() const {
01019 //-------------------------------------------------------------------------------
01020    return fTypeTemplates.begin();
01021 }
01022 
01023 
01024 //-------------------------------------------------------------------------------
01025 inline Reflex::TypeTemplate_Iterator
01026 Reflex::ScopeBase::SubTypeTemplate_End() const {
01027 //-------------------------------------------------------------------------------
01028    return fTypeTemplates.end();
01029 }
01030 
01031 
01032 //-------------------------------------------------------------------------------
01033 inline Reflex::Reverse_TypeTemplate_Iterator
01034 Reflex::ScopeBase::SubTypeTemplate_RBegin() const {
01035 //-------------------------------------------------------------------------------
01036    return ((const std::vector<TypeTemplate> &)fTypeTemplates).rbegin();
01037 }
01038 
01039 
01040 //-------------------------------------------------------------------------------
01041 inline Reflex::Reverse_TypeTemplate_Iterator
01042 Reflex::ScopeBase::SubTypeTemplate_REnd() const {
01043 //-------------------------------------------------------------------------------
01044    return ((const std::vector<TypeTemplate> &)fTypeTemplates).rend();
01045 }
01046 
01047 
01048 //-------------------------------------------------------------------------------
01049 inline
01050 bool
01051 Reflex::ScopeBase::HasBase(const Type&) const {
01052 //-------------------------------------------------------------------------------
01053    return false;
01054 }
01055 
01056 
01057 //-------------------------------------------------------------------------------
01058 inline bool
01059 Reflex::ScopeBase::UpdateMembers() const {
01060 //-------------------------------------------------------------------------------
01061 // Initialize the vector of inherited members.
01062 // Return false if one of the bases is not complete.
01063 
01064    return true;
01065 }
01066 
01067 
01068 //-------------------------------------------------------------------------------
01069 inline bool
01070 Reflex::ScopeBase::IsClass() const {
01071 //-------------------------------------------------------------------------------
01072    return fScopeType == CLASS ||
01073           fScopeType == TYPETEMPLATEINSTANCE ||
01074           fScopeType == STRUCT;
01075 }
01076 
01077 
01078 //-------------------------------------------------------------------------------
01079 inline bool
01080 Reflex::ScopeBase::IsEnum() const {
01081 //-------------------------------------------------------------------------------
01082    return fScopeType == ENUM;
01083 }
01084 
01085 
01086 //-------------------------------------------------------------------------------
01087 inline bool
01088 Reflex::ScopeBase::IsNamespace() const {
01089 //-------------------------------------------------------------------------------
01090    return fScopeType == NAMESPACE;
01091 }
01092 
01093 
01094 inline bool
01095 ROOT::Reflex::ScopeBase::IsTemplateInstance() const {
01096 //-------------------------------------------------------------------------------
01097    return fScopeType == TYPETEMPLATEINSTANCE;
01098 }
01099 
01100 
01101 //-------------------------------------------------------------------------------
01102 inline bool
01103 Reflex::ScopeBase::IsUnion() const {
01104 //-------------------------------------------------------------------------------
01105    return fScopeType == UNION;
01106 }
01107 
01108 
01109 //-------------------------------------------------------------------------------
01110 inline Reflex::TYPE
01111 Reflex::ScopeBase::ScopeType() const {
01112 //-------------------------------------------------------------------------------
01113    return fScopeType;
01114 }
01115 
01116 
01117 //-------------------------------------------------------------------------------
01118 inline Reflex::Scope
01119 Reflex::ScopeBase::SubScopeAt(size_t nth) const {
01120 //-------------------------------------------------------------------------------
01121    if (nth < fSubScopes.size()) {
01122       return fSubScopes[nth];
01123    }
01124    return Dummy::Scope();
01125 }
01126 
01127 
01128 //-------------------------------------------------------------------------------
01129 inline size_t
01130 Reflex::ScopeBase::SubScopeSize() const {
01131 //-------------------------------------------------------------------------------
01132    return fSubScopes.size();
01133 }
01134 
01135 
01136 //-------------------------------------------------------------------------------
01137 inline Reflex::Scope
01138 Reflex::ScopeBase::UsingDirectiveAt(size_t nth) const {
01139 //-------------------------------------------------------------------------------
01140    if (nth < fUsingDirectives.size()) {
01141       return fUsingDirectives[nth];
01142    }
01143    return Dummy::Scope();
01144 }
01145 
01146 
01147 //-------------------------------------------------------------------------------
01148 inline size_t
01149 Reflex::ScopeBase::UsingDirectiveSize() const {
01150 //-------------------------------------------------------------------------------
01151    return fUsingDirectives.size();
01152 }
01153 
01154 
01155 //-------------------------------------------------------------------------------
01156 inline Reflex::Scope_Iterator
01157 Reflex::ScopeBase::UsingDirective_Begin() const {
01158 //-------------------------------------------------------------------------------
01159    return fUsingDirectives.begin();
01160 }
01161 
01162 
01163 //-------------------------------------------------------------------------------
01164 inline Reflex::Scope_Iterator
01165 Reflex::ScopeBase::UsingDirective_End() const {
01166 //-------------------------------------------------------------------------------
01167    return fUsingDirectives.end();
01168 }
01169 
01170 
01171 //-------------------------------------------------------------------------------
01172 inline Reflex::Reverse_Scope_Iterator
01173 Reflex::ScopeBase::UsingDirective_RBegin() const {
01174 //-------------------------------------------------------------------------------
01175    return ((const std::vector<Scope> &)fUsingDirectives).rbegin();
01176 }
01177 
01178 
01179 //-------------------------------------------------------------------------------
01180 inline Reflex::Reverse_Scope_Iterator
01181 Reflex::ScopeBase::UsingDirective_REnd() const {
01182 //-------------------------------------------------------------------------------
01183    return ((const std::vector<Scope> &)fUsingDirectives).rend();
01184 }
01185 
01186 
01187 #ifdef _WIN32
01188 # pragma warning( pop )
01189 #endif
01190 
01191 #endif // Reflex_ScopeBase

Generated on Tue Jul 5 14:25:52 2011 for ROOT_528-00b_version by  doxygen 1.5.1