Scope.h

Go to the documentation of this file.
00001 // @(#)root/reflex:$Id: Scope.h 32228 2010-02-05 16:13:09Z 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_Scope
00013 #define Reflex_Scope
00014 
00015 // Include files
00016 #include "Reflex/Kernel.h"
00017 #include <string>
00018 #include <typeinfo>
00019 
00020 namespace Reflex {
00021 // forward declarations
00022 class Base;
00023 class Member;
00024 class PropertyList;
00025 class Type;
00026 class ScopeBase;
00027 class ScopeName;
00028 class TypeTemplate;
00029 class MemberTemplate;
00030 class DictionaryGenerator;
00031 
00032 
00033 /**
00034  * @class Scope Scope.h Reflex/Scope.h
00035  * @author Stefan Roiser
00036  * @date 24/11/2003
00037  * @ingroup Ref
00038  */
00039 class RFLX_API Scope {
00040 public:
00041    /** constructor */
00042    Scope(const ScopeName * scopeName = 0);
00043 
00044 
00045    /** copy constructor */
00046    Scope(const Scope &rh);
00047 
00048 
00049    /** destructor */
00050    ~Scope();
00051 
00052 
00053    /**
00054     * inequal operator
00055     */
00056    bool operator !=(const Scope& rh) const;
00057 
00058 
00059    /**
00060     * the bool operator will return true if the Scope is resolved (implemented)
00061     * @return true if Scope is implemented
00062     */
00063    operator bool() const;
00064 
00065 #if defined(REFLEX_CINT_MERGE)
00066    // To prevent any un-authorized use as the old type
00067    bool
00068    operator !() const { return !operator bool(); }
00069 
00070    bool
00071    operator &&(bool right) const { return operator bool() && right; }
00072 
00073    bool
00074    operator &&(int right) const { return operator bool() && right; }
00075 
00076    bool
00077    operator &&(long right) const { return operator bool() && right; }
00078 
00079    bool operator &&(const Scope& right) const;
00080    bool operator &&(const Type& right) const;
00081    bool operator &&(const Member& right) const;
00082    bool
00083    operator ||(bool right) const { return operator bool() || right; }
00084 
00085    bool
00086    operator ||(int right) const { return operator bool() || right; }
00087 
00088    bool
00089    operator ||(long right) const { return operator bool() || right; }
00090 
00091    bool operator ||(const Scope& right) const;
00092    bool operator ||(const Type& right) const;
00093    bool operator ||(const Member& right) const;
00094 
00095 private:
00096    operator int() const;
00097 
00098 public:
00099 #endif
00100 
00101 
00102    /**
00103     * the operator Type will return a corresponding type object to the scope if
00104     * applicable (i.e. if the Scope is also a Type e.g. Class, Union, Enum)
00105     */
00106    operator Type() const;
00107 
00108 
00109    /**
00110     * BaseAt will return the nth base class information
00111     * @param  nth base class
00112     * @return pointer to base class information
00113     */
00114    Base BaseAt(size_t nth) const;
00115 
00116 
00117    /**
00118     * BaseSize will return the number of base classes
00119     * @return number of base classes
00120     */
00121    size_t BaseSize() const;
00122 
00123 
00124    /**
00125     * Base_Begin returns the begin of the container of bases
00126     * @return begin of container of bases
00127     */
00128    Base_Iterator Base_Begin() const;
00129 
00130 
00131    /**
00132     * Base_End returns the end of the container of bases
00133     * @return end of container of bases
00134     */
00135    Base_Iterator Base_End() const;
00136 
00137 
00138    /**
00139     * Base_RBegin returns the reverse begin of the container of bases
00140     * @return reverse begin of container of bases
00141     */
00142    Reverse_Base_Iterator Base_RBegin() const;
00143 
00144 
00145    /**
00146     * Base_REnd returns the reverse end of the container of bases
00147     * @return reverse end of container of bases
00148     */
00149    Reverse_Base_Iterator Base_REnd() const;
00150 
00151 
00152    /**
00153     * ByName will return reflection information of the scope passed as argument
00154     * @param  name fully qualified name of the scope
00155     * @return reflection information of the scope
00156     */
00157    static Scope ByName(const std::string& name);
00158 
00159 
00160    /**
00161     * DataMemberAt will return the nth data member of the type
00162     * @param  nth the nth data member
00163     * @return nth data member
00164     */
00165    Member DataMemberAt(size_t nth,
00166                        EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00167 
00168 
00169    /**
00170     * DataMemberByName will lookup a data member by name
00171     * @param  name of data member
00172     * @return data member
00173     */
00174    Member DataMemberByName(const std::string& name,
00175                            EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00176 
00177 
00178    /**
00179     * DataMemberSize will return the number of data members of this type
00180     * @return number of data members
00181     */
00182    size_t DataMemberSize(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00183 
00184 
00185    /**
00186     * Member_Begin returns the begin of the container of members
00187     * @return begin of container of members
00188     */
00189    Member_Iterator DataMember_Begin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00190 
00191 
00192    /**
00193     * Member_End returns the end of the container of members
00194     * @return end of container of members
00195     */
00196    Member_Iterator DataMember_End(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00197 
00198 
00199    /**
00200     * Member_RBegin returns the reverse begin of the container of members
00201     * @return reverse begin of container of members
00202     */
00203    Reverse_Member_Iterator DataMember_RBegin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00204 
00205 
00206    /**
00207     * Member_REnd returns the reverse end of the container of members
00208     * @return reverse end of container of members
00209     */
00210    Reverse_Member_Iterator DataMember_REnd(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00211 
00212 
00213    /**
00214     * DeclaringScope will return the declaring socpe of this type
00215     * @return declaring scope of this type
00216     */
00217    Scope DeclaringScope() const;
00218 
00219 
00220    /**
00221     * FunctionMemberAt will return the nth function member of the type
00222     * @param  nth function member
00223     * @return reflection information of nth function member
00224     */
00225    Member FunctionMemberAt(size_t nth,
00226                            EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00227 
00228 
00229    /**
00230     * FunctionMemberByName will return the member with the name,
00231     * optionally the signature of the function may be given as a type
00232     * @param  name of function member
00233     * @return reflection information of the function member
00234     */
00235    Member FunctionMemberByName(const std::string& name,
00236                                EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT,
00237                                EDELAYEDLOADSETTING allowDelayedLoad = DELAYEDLOAD_ON) const;
00238 
00239 
00240    /**
00241     * FunctionMemberByName will return the member with the name,
00242     * optionally the signature of the function may be given as a type
00243     * @param  name of function member
00244     * @param  signature of the member function
00245     * @modifiers_mask When matching, do not compare the listed modifiers
00246     * @return reflection information of the function member
00247     */
00248    // this overloading is unfortunate but I can't include Type.h here
00249    Member FunctionMemberByName(const std::string& name,
00250                                const Type& signature,
00251                                unsigned int modifers_mask = 0,
00252                                EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT,
00253                                EDELAYEDLOADSETTING allowDelayedLoad = DELAYEDLOAD_ON) const;
00254 
00255 
00256    /**
00257     * FunctionMemberByNameAndSignature will return the member with the name,
00258     * optionally the signature of the function may be given as a type
00259     * @param  name of function member
00260     * @param  signature of the member function
00261     * @modifiers_mask When matching, do not compare the listed modifiers
00262     * @return reflection information of the function member
00263     */
00264    // this overloading is unfortunate but I can't include Type.h here
00265    Member FunctionMemberByNameAndSignature(const std::string& name,
00266                                            const Type& signature,
00267                                            unsigned int modifers_mask = 0,
00268                                            EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT,
00269                                            EDELAYEDLOADSETTING allowDelayedLoad = DELAYEDLOAD_ON) const;
00270 
00271 
00272    /**
00273     * FunctionMemberSize will return the number of function members of
00274     * this type
00275     * @return number of function members
00276     */
00277    size_t FunctionMemberSize(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00278 
00279 
00280    /**
00281     * FunctionMember_Begin returns the begin of the container of function members
00282     * @return begin of container of function members
00283     */
00284    Member_Iterator FunctionMember_Begin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00285 
00286 
00287    /**
00288     * FunctionMember_End returns the end of the container of function members
00289     * @return end of container of function members
00290     */
00291    Member_Iterator FunctionMember_End(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00292 
00293 
00294    /**
00295     * FunctionMember_RBegin returns the reverse begin of the container of function members
00296     * @return reverse begin of container of function members
00297     */
00298    Reverse_Member_Iterator FunctionMember_RBegin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00299 
00300 
00301    /**
00302     * FunctionMember_RBegin returns the reverse begin of the container of function members
00303     * @return reverse begin of container of function members
00304     */
00305    Reverse_Member_Iterator FunctionMember_REnd(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00306 
00307 
00308    /**
00309     * GenerateDict will produce the dictionary information of this type
00310     * @param generator a reference to the dictionary generator instance
00311     */
00312    void GenerateDict(DictionaryGenerator& generator) const;
00313 
00314 
00315    /**
00316     * GlobalScope will return the global scope representation\
00317     * @return global scope
00318     */
00319    static Scope GlobalScope();
00320 
00321 
00322    /**
00323     * HasBase will check whether this class has a base class given
00324     * as argument
00325     * @param  cl the base-class to check for
00326     * @return the Base info if it is found, an empty base otherwise (can be tested for bool)
00327     */
00328    bool HasBase(const Type& cl) const;
00329 
00330 
00331    /**
00332     * Id returns a unique identifier of the type in the system
00333     * @return unique identifier
00334     */
00335    void* Id() const;
00336 
00337 
00338    /**
00339     * IsClass returns true if the type represents a class
00340     * @return true if type represents a class
00341     */
00342    bool IsClass() const;
00343 
00344 
00345    /**
00346     * IsEnum returns true if the type represents a enum
00347     * @return true if type represents a enum
00348     */
00349    bool IsEnum() const;
00350 
00351 
00352    /**
00353     * IsNamespace returns true if the scope represents a namespace
00354     * @return true if scope represents a namespace
00355     */
00356    bool IsNamespace() const;
00357 
00358 
00359    /**
00360     * IsPrivate will check if the scope access is private
00361     * @return true if scope access is private
00362     */
00363    bool IsPrivate() const;
00364 
00365 
00366    /**
00367     * IsProtected will check if the scope access is protected
00368     * @return true if scope access is protected
00369     */
00370    bool IsProtected() const;
00371 
00372 
00373    /**
00374     * IsPublic will check if the scope access is public
00375     * @return true if scope access is public
00376     */
00377    bool IsPublic() const;
00378 
00379 
00380    /**
00381     * IsTemplateInstance will return true if the the class is templated
00382     * @return true if the class is templated
00383     */
00384    bool IsTemplateInstance() const;
00385 
00386 
00387    /**
00388     * IsTopScope returns true if this scope is the top scope
00389     * @return true if this scope is the top scope
00390     */
00391    bool IsTopScope() const;
00392 
00393 
00394    /**
00395     * IsUnion returns true if the type represents a union
00396     * @return true if type represents a union
00397     */
00398    bool IsUnion() const;
00399 
00400 
00401    /**
00402     * LookupMember will lookup a member in the current scope
00403     * @param nam the string representation of the member to lookup
00404     * @return if a matching member is found return it, otherwise return empty member
00405     */
00406    Member LookupMember(const std::string& nam) const;
00407 
00408 
00409    /**
00410     * LookupType will lookup a type in the current scope
00411     * @param nam the string representation of the type to lookup
00412     * @return if a matching type is found return it, otherwise return empty type
00413     */
00414    Type LookupType(const std::string& nam) const;
00415 
00416 
00417    /**
00418     * LookupScope will lookup a scope in the current scope
00419     * @param nam the string representation of the scope to lookup
00420     * @return if a matching scope is found return it, otherwise return empty scope
00421     */
00422    Scope LookupScope(const std::string& nam) const;
00423 
00424 
00425    /**
00426     * MemberAt will return the nth member of the type
00427     * @param  nth member
00428     * @return reflection information nth member
00429     */
00430    Member MemberAt(size_t nth,
00431                    EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00432 
00433 
00434    /**
00435     * MemberByName will return the first member with a given Name
00436     * @param  member name
00437     * @return reflection information of the member
00438     */
00439    Member MemberByName(const std::string& name,
00440                        EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00441 
00442 
00443    /**
00444     * MemberByName will return the first member with a given Name
00445     * @param  member name
00446     * @param  signature of the (function) member
00447     * @return reflection information of the member
00448     */
00449    // this overloading is unfortunate but I can't include Type.h here
00450    Member MemberByName(const std::string& name,
00451                        const Type& signature,
00452                        EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00453 
00454 
00455    /**
00456     * MemberSize will return the number of members
00457     * @return number of members
00458     */
00459    size_t MemberSize(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00460 
00461 
00462    /**
00463     * Member_Begin returns the begin of the container of members
00464     * @return begin of container of members
00465     */
00466    Member_Iterator Member_Begin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00467 
00468 
00469    /**
00470     * Member_End returns the end of the container of members
00471     * @return end of container of members
00472     */
00473    Member_Iterator Member_End(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00474 
00475 
00476    /**
00477     * Member_RBegin returns the reverse begin of the container of members
00478     * @return reverse begin of container of members
00479     */
00480    Reverse_Member_Iterator Member_RBegin(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00481 
00482 
00483    /**
00484     * Member_REnd returns the reverse end of the container of members
00485     * @return reverse end of container of members
00486     */
00487    Reverse_Member_Iterator Member_REnd(EMEMBERQUERY inh = INHERITEDMEMBERS_DEFAULT) const;
00488 
00489 
00490    /**
00491     * MemberTemplateAt will return the nth member template of this type
00492     * @param nth member template
00493     * @return nth member template
00494     */
00495    MemberTemplate MemberTemplateAt(size_t nth) const;
00496 
00497 
00498    /**
00499     * MemberTemplateSize will return the number of member templates in this scope
00500     * @return number of defined member templates
00501     */
00502    size_t MemberTemplateSize() const;
00503 
00504 
00505    /**
00506     * MemberTemplateByName will return the member template representation in this
00507     * scope
00508     * @param string representing the member template to look for
00509     * @return member template representation of the looked up member
00510     */
00511    MemberTemplate MemberTemplateByName(const std::string& nam) const;
00512 
00513 
00514    /**
00515     * MemberTemplate_Begin returns the begin of the container of member templates
00516     * @return begin of container of member templates
00517     */
00518    MemberTemplate_Iterator MemberTemplate_Begin() const;
00519 
00520 
00521    /**
00522     * MemberTemplate_End returns the end of the container of member templates
00523     * @return end of container of member templates
00524     */
00525    MemberTemplate_Iterator MemberTemplate_End() const;
00526 
00527 
00528    /**
00529     * MemberTemplate_End returns the end of the container of member templates
00530     * @return end of container of member templates
00531     */
00532    Reverse_MemberTemplate_Iterator MemberTemplate_RBegin() const;
00533 
00534 
00535    /**
00536     * MemberTemplate_REnd returns the reverse end of the container of member templates
00537     * @return reverse end of container of member templates
00538     */
00539    Reverse_MemberTemplate_Iterator MemberTemplate_REnd() const;
00540 
00541 
00542    /**
00543     * Name returns the name of the type
00544     * @param  mod qualifiers can be or'ed
00545     *   FINAL     - resolve typedefs
00546     *   SCOPED    - fully scoped name
00547     *   QUALIFIED - cv, reference qualification
00548     * @return name of the type
00549     */
00550    std::string Name(unsigned int mod = 0) const;
00551 
00552 
00553    /**
00554     * Name_c_str returns a char* pointer to the qualified type name
00555     * @return c string to unqualified type name
00556     */
00557    const char* Name_c_str() const;
00558 
00559    /**
00560     * Properties will return a PropertyList attached to this item
00561     * @return PropertyList of this type
00562     */
00563    PropertyList Properties() const;
00564 
00565 
00566    /**
00567     * ScopeAt will return the nth scope defined in the system
00568     * @param  nth scope defined in the system
00569     * @return nth scope defined in the system
00570     */
00571    static Scope ScopeAt(size_t nth);
00572 
00573 
00574    /**
00575     * ScopeSize will return the number of currently defined scopes
00576     * @return number of currently defined scopes
00577     */
00578    static size_t ScopeSize();
00579 
00580 
00581    /**
00582     * Scope_Begin returns the begin of the container of scopes defined in the systems
00583     * @return begin of container of scopes defined in the systems
00584     */
00585    static Scope_Iterator Scope_Begin();
00586 
00587 
00588    /**
00589     * Scope_End returns the end of the container of scopes defined in the systems
00590     * @return end of container of scopes defined in the systems
00591     */
00592    static Scope_Iterator Scope_End();
00593 
00594 
00595    /**
00596     * Scope_RBegin returns the reverse begin of the container of scopes defined in the systems
00597     * @return reverse begin of container of scopes defined in the systems
00598     */
00599    static Reverse_Scope_Iterator Scope_RBegin();
00600 
00601 
00602    /**
00603     * Scope_REnd returns the reverse end of the container of scopes defined in the systems
00604     * @return reverse end of container of scopes defined in the systems
00605     */
00606    static Reverse_Scope_Iterator Scope_REnd();
00607 
00608 
00609    /**
00610     * ScopeType will return the enum information about this scope
00611     * @return enum information of this scope
00612     */
00613    TYPE ScopeType() const;
00614 
00615 
00616    /**
00617     * ScopeTypeAsString will return the string representation of the ENUM
00618     * representing the real type of the scope (e.g. "CLASS")
00619     * @return string representation of the TYPE enum of the scope
00620     */
00621    std::string ScopeTypeAsString() const;
00622 
00623 
00624    /**
00625     * SubScopeAt will return a pointer to a sub scopes
00626     * @param  nth sub scope
00627     * @return reflection information of nth sub scope
00628     */
00629    Scope SubScopeAt(size_t nth) const;
00630 
00631 
00632    /**
00633     * SubScopeLevel will return the number of declaring scopes
00634     * this scope lives in.
00635     * @return number of declaring scopes above this scope.
00636     */
00637    size_t SubScopeLevel() const;
00638 
00639 
00640    /**
00641     * SubScopeSize will return the number of sub scopes
00642     * @return number of sub scopes
00643     */
00644    size_t SubScopeSize() const;
00645 
00646 
00647    /**
00648     * SubScopeByName will return a sub scope representing the unscoped name passed
00649     * as argument
00650     * @param unscoped name of the sub scope to look for
00651     * @return Scope representation of the sub scope
00652     */
00653    Scope SubScopeByName(const std::string& nam) const;
00654 
00655 
00656    /**
00657     * SubScope_Begin returns the begin of the container of sub scopes
00658     * @return begin of container of sub scopes
00659     */
00660    Scope_Iterator SubScope_Begin() const;
00661 
00662 
00663    /**
00664     * SubScope_End returns the end of the container of sub scopes
00665     * @return end of container of sub scopes
00666     */
00667    Scope_Iterator SubScope_End() const;
00668 
00669 
00670    /**
00671     * SubScope_RBegin returns the reverse begin of the container of sub scopes
00672     * @return reverse begin of container of sub scopes
00673     */
00674    Reverse_Scope_Iterator SubScope_RBegin() const;
00675 
00676 
00677    /**
00678     * SubScope_REnd returns the reverse end of the container of sub scopes
00679     * @return reverse end of container of sub scopes
00680     */
00681    Reverse_Scope_Iterator SubScope_REnd() const;
00682 
00683 
00684    /**
00685     * SubTypeAt will return the nth sub type
00686     * @param  nth sub type
00687     * @return reflection information of nth sub type
00688     */
00689    Type SubTypeAt(size_t nth) const;
00690 
00691 
00692    /**
00693     * SubTypeSize will return he number of sub types
00694     * @return number of sub types
00695     */
00696    size_t SubTypeSize() const;
00697 
00698 
00699    /**
00700     * SubTypeByName will return the Type representing the sub type
00701     * @param string of the unscoped sub type to look for
00702     * @return Type representation of the sub type
00703     */
00704    Type SubTypeByName(const std::string& nam) const;
00705 
00706 
00707    /**
00708     * SubType_Begin returns the begin of the container of sub types
00709     * @return begin of container of sub types
00710     */
00711    Type_Iterator SubType_Begin() const;
00712 
00713 
00714    /**
00715     * SubType_End returns the end of the container of sub types
00716     * @return end of container of sub types
00717     */
00718    Type_Iterator SubType_End() const;
00719 
00720 
00721    /**
00722     * SubType_RBegin returns the reverse begin of the container of sub types
00723     * @return reverse begin of container of sub types
00724     */
00725    Reverse_Type_Iterator SubType_RBegin() const;
00726 
00727 
00728    /**
00729     * SubType_REnd returns the reverse end of the container of sub types
00730     * @return reverse end of container of sub types
00731     */
00732    Reverse_Type_Iterator SubType_REnd() const;
00733 
00734 
00735    /**
00736     * SubTypeTemplateAt will return the nth type template of this type
00737     * @param nth type template
00738     * @return nth type template
00739     */
00740    TypeTemplate SubTypeTemplateAt(size_t nth) const;
00741 
00742 
00743    /**
00744     * SubTypeTemplateSize will return the number of type templates in this scope
00745     * @return number of defined type templates
00746     */
00747    size_t SubTypeTemplateSize() const;
00748 
00749 
00750    /**
00751     * SubTypeTemplateByName will return a type template defined in this scope looked up by
00752     * it's unscoped name
00753     * @param unscoped name of the type template to look for
00754     * @return TypeTemplate representation of the sub type template
00755     */
00756    TypeTemplate SubTypeTemplateByName(const std::string& nam) const;
00757 
00758 
00759    /**
00760     * SubTypeTemplate_Begin returns the begin of the container of sub type templates
00761     * @return begin of container of sub type templates
00762     */
00763    TypeTemplate_Iterator SubTypeTemplate_Begin() const;
00764 
00765 
00766    /**
00767     * SubTypeTemplate_End returns the end of the container of sub type templates
00768     * @return end of container of sub type templates
00769     */
00770    TypeTemplate_Iterator SubTypeTemplate_End() const;
00771 
00772 
00773    /**
00774     * SubTypeTemplate_RBegin returns the reverse begin of the container of sub type templates
00775     * @return reverse begin of container of sub type templates
00776     */
00777    Reverse_TypeTemplate_Iterator SubTypeTemplate_RBegin() const;
00778 
00779 
00780    /**
00781     * SubTypeTemplate_REnd returns the reverse end of the container of sub type templates
00782     * @return reverse end of container of sub type templates
00783     */
00784    Reverse_TypeTemplate_Iterator SubTypeTemplate_REnd() const;
00785 
00786 
00787    /**
00788     * TemplateArgumentAt will return a pointer to the nth template argument
00789     * @param  nth nth template argument
00790     * @return reflection information of nth template argument
00791     */
00792    Type TemplateArgumentAt(size_t nth) const;
00793 
00794 
00795    /**
00796     * TemplateArgumentSize will return the number of template arguments
00797     * @return number of template arguments
00798     */
00799    size_t TemplateArgumentSize() const;
00800 
00801 
00802    /**
00803     * TemplateArgument_Begin returns the begin of the container of template arguments
00804     * @return begin of container of template arguments
00805     */
00806    Type_Iterator TemplateArgument_Begin() const;
00807 
00808 
00809    /**
00810     * TemplateArgument_End returns the end of the container of template arguments
00811     * @return end of container of template arguments
00812     */
00813    Type_Iterator TemplateArgument_End() const;
00814 
00815 
00816    /**
00817     * TemplateArgument_RBegin returns the reverse begin of the container of template arguments
00818     * @return reverse begin of container of template arguments
00819     */
00820    Reverse_Type_Iterator TemplateArgument_RBegin() const;
00821 
00822 
00823    /**
00824     * TemplateArgument_REnd returns the reverse end of the container of template arguments
00825     * @return reverse end of container of template arguments
00826     */
00827    Reverse_Type_Iterator TemplateArgument_REnd() const;
00828 
00829 
00830    /**
00831     * TemplateFamily returns the corresponding TypeTemplate if any
00832     * @return corresponding TypeTemplate
00833     */
00834    TypeTemplate TemplateFamily() const;
00835 
00836 
00837    /**
00838     * Unload will unload the dictionary information of a scope
00839     */
00840    void Unload() const;
00841 
00842 
00843    /**
00844     * UpdateMembers will update the list of Function/Data/Members with all
00845     * members of base classes currently availabe in the system, switching
00846     * INHERITEDMEMBERS_DEFAULT to INHERITEDMEMBERS_ALSO.
00847     */
00848    void UpdateMembers() const;
00849 
00850    /**
00851     * UsingDirectiveAt will return the nth using directive
00852     * @param  nth using directive
00853     * @return nth using directive
00854     */
00855    Scope UsingDirectiveAt(size_t nth) const;
00856 
00857 
00858    /**
00859     * UsingDirectiveSize will return the number of using directives of this scope
00860     * @return number of using directives declared in this scope
00861     */
00862    size_t UsingDirectiveSize() const;
00863 
00864 
00865    Scope_Iterator UsingDirective_Begin() const;
00866    Scope_Iterator UsingDirective_End() const;
00867    Reverse_Scope_Iterator UsingDirective_RBegin() const;
00868    Reverse_Scope_Iterator UsingDirective_REnd() const;
00869 
00870 public:
00871    /**
00872     * AddBase will add information about a Base class
00873     * @param base type of the base class
00874     * @param offsFP pointer to a function stub for calculating the base class offset
00875     * @param modifiers the modifiers of the base class
00876     */
00877    void AddBase(const Type& bas,
00878                 OffsetFunction offsFP,
00879                 unsigned int modifiers = 0) const;
00880 
00881 
00882    /**
00883     * AddBase will add the information about a Base class
00884     * @param b pointer to the base class
00885     */
00886    void AddBase(const Base& b) const;
00887 
00888 
00889    /**
00890     * AddDataMember will add the information about a data member
00891     * @param dm data member to add
00892     */
00893    void AddDataMember(const Member& dm) const;
00894 
00895 
00896    /**
00897     * AddDataMember will add the information about a data member
00898     * @param nam the name of the data member
00899     * @param typ the type of the data member
00900     * @param offs the offset of the data member relative to the beginning of the scope
00901     * @param modifiers of the data member
00902     */
00903    Member AddDataMember(const char* name,
00904                         const Type& type,
00905                         size_t offset,
00906                         unsigned int modifiers = 0,
00907                         char* interpreterOffset = 0) const;
00908 
00909    /**
00910     * AddFunctionMember will add the information about a function member
00911     * @param fm function member to add
00912     */
00913    void AddFunctionMember(const Member& fm) const;
00914 
00915 
00916    /**
00917     * AddFunctionMember will add the information about a function member
00918     * @param nam the name of the function member
00919     * @param typ the type of the function member
00920     * @param stubFP a pointer to the stub function
00921     * @param stubCtx a pointer to the context of the function member
00922     * @param params a semi colon separated list of parameters
00923     * @param modifiers of the function member
00924     */
00925    Member AddFunctionMember(const char* name,
00926                             const Type& type,
00927                             StubFunction stubFP,
00928                             void* stubCtx = 0,
00929                             const char* params = 0,
00930                             unsigned int modifiers = 0) const;
00931 
00932 
00933    /**
00934     * AddMemberTemplate will add a member template to this scope
00935     * @param mt member template to add
00936     */
00937    void AddMemberTemplate(const MemberTemplate& mt) const;
00938 
00939 
00940    /**
00941     * AddSubScope will add a sub scope to this one
00942     * @param sc sub scope to add
00943     */
00944    void AddSubScope(const Scope& sc) const;
00945 
00946 
00947    /**
00948     * AddSubScope will add a sub scope to this one
00949     * @param scop the name of the sub scope
00950     * @param scopeType enum value of the scope type
00951     */
00952    void AddSubScope(const char* scope,
00953                     TYPE scopeType = NAMESPACE) const;
00954 
00955 
00956    /**
00957     * AddSubType will add a sub type to this type
00958     * @param ty sub type to add
00959     */
00960    void AddSubType(const Type& ty) const;
00961 
00962 
00963    /**
00964     * AddSubType will add a sub type to this type
00965     * @param typ the name of the sub type
00966     * @param size the sizeof of the sub type
00967     * @param typeType the enum specifying the sub type
00968     * @param ti the type_info of the sub type
00969     * @param modifiers of the sub type
00970     */
00971    void AddSubType(const char* type,
00972                    size_t size,
00973                    TYPE typeType,
00974                    const std::type_info& typeInfo,
00975                    unsigned int modifiers = 0) const;
00976 
00977 
00978    /**
00979     * AddTypeTemplate will add a sub type template to this scope
00980     * @param tt type template to add
00981     */
00982    void AddSubTypeTemplate(const TypeTemplate& mt) const;
00983 
00984 
00985    /**
00986     * AddUsingDirective will add a using namespace directive to this scope
00987     * @param ud using directive to add
00988     */
00989    void AddUsingDirective(const Scope& ud) const;
00990 
00991 
00992    /**
00993     * RemoveDataMember will remove the information about a data member
00994     * @param dm data member to remove
00995     */
00996    void RemoveDataMember(const Member& dm) const;
00997 
00998 
00999    /**
01000     * RemoveFunctionMember will remove the information about a function member
01001     * @param fm function member to remove
01002     */
01003    void RemoveFunctionMember(const Member& fm) const;
01004 
01005 
01006    /**
01007     * RemoveMemberTemplate will remove a member template from this scope
01008     * @param mt member template to remove
01009     */
01010    void RemoveMemberTemplate(const MemberTemplate& mt) const;
01011 
01012 
01013    /**
01014     * RemoveSubScope will remove a sub scope from this type
01015     * @param sc sub scope to remove
01016     */
01017    void RemoveSubScope(const Scope& sc) const;
01018 
01019 
01020    /**
01021     * RemoveSubType will remove a sub type from this type
01022     * @param sc sub type to remove
01023     */
01024    void RemoveSubType(const Type& ty) const;
01025 
01026 
01027    /**
01028     * RemoveSubTypeTemplate will remove a sub type template from this scope
01029     * @param tt sub type template to remove
01030     */
01031    void RemoveSubTypeTemplate(const TypeTemplate& tt) const;
01032 
01033 
01034    /**
01035     * RemoveUsingDirective will remove a using namespace directive from this scope
01036     * @param ud using namespace directive to remove
01037     */
01038    void RemoveUsingDirective(const Scope& ud) const;
01039 
01040 
01041    /** */
01042    const ScopeBase* ToScopeBase() const;
01043 
01044 public:
01045    /**
01046     * @label __NIRVANA__
01047     * @link association
01048     */
01049    static Scope& __NIRVANA__();
01050 
01051 private:
01052    /**
01053     * pointer to the resolved scope
01054     * @label scope name
01055     * @link aggregation
01056     * @supplierCardinality 1
01057     * @clientCardinality 1
01058     */
01059    const ScopeName* fScopeName;
01060 
01061 };    // class Scope
01062 
01063 bool operator <(const Scope& lh,
01064                 const Scope& rh);
01065 
01066 bool operator ==(const Scope& lh,
01067                  const Scope& rh);
01068 
01069 } // namespace Reflex
01070 
01071 #include "Reflex/internal/ScopeBase.h"
01072 #include "Reflex/internal/ScopeName.h"
01073 #include "Reflex/PropertyList.h"
01074 
01075 
01076 //-------------------------------------------------------------------------------
01077 inline bool
01078 Reflex::Scope::operator !=(const Scope& rh) const {
01079 //-------------------------------------------------------------------------------
01080    return fScopeName != rh.fScopeName;
01081 }
01082 
01083 
01084 //-------------------------------------------------------------------------------
01085 inline bool
01086 Reflex::operator <(const Scope& lh,
01087                    const Scope& rh) {
01088 //-------------------------------------------------------------------------------
01089    return const_cast<Scope*>(&lh)->Id() < const_cast<Scope*>(&rh)->Id();
01090 }
01091 
01092 
01093 //-------------------------------------------------------------------------------
01094 inline bool
01095 Reflex::operator ==(const Scope& lh,
01096                     const Scope& rh) {
01097 //-------------------------------------------------------------------------------
01098    return const_cast<Scope*>(&lh)->Id() == const_cast<Scope*>(&rh)->Id();
01099 }
01100 
01101 
01102 //-------------------------------------------------------------------------------
01103 inline Reflex::Scope::Scope(const ScopeName* scopeName)
01104 //-------------------------------------------------------------------------------
01105    : fScopeName(scopeName) {
01106 }
01107 
01108 
01109 //-------------------------------------------------------------------------------
01110 inline Reflex::Scope::Scope(const Scope& rh)
01111 //-------------------------------------------------------------------------------
01112    : fScopeName(rh.fScopeName) {
01113 }
01114 
01115 
01116 //-------------------------------------------------------------------------------
01117 inline Reflex::Scope::~Scope() {
01118 //-------------------------------------------------------------------------------
01119 }
01120 
01121 
01122 //-------------------------------------------------------------------------------
01123 inline
01124 Reflex::Scope::operator bool() const {
01125 //-------------------------------------------------------------------------------
01126    if (this->fScopeName && this->fScopeName->fScopeBase) {
01127       return true;
01128    }
01129    //throw RuntimeError("Scope is not implemented");
01130    return false;
01131 }
01132 
01133 
01134 //-------------------------------------------------------------------------------
01135 inline Reflex::Base_Iterator
01136 Reflex::Scope::Base_Begin() const {
01137 //-------------------------------------------------------------------------------
01138    if (*this) {
01139       return fScopeName->fScopeBase->Base_Begin();
01140    }
01141    return Dummy::BaseCont().begin();
01142 }
01143 
01144 
01145 //-------------------------------------------------------------------------------
01146 inline Reflex::Base_Iterator
01147 Reflex::Scope::Base_End() const {
01148 //-------------------------------------------------------------------------------
01149    if (*this) {
01150       return fScopeName->fScopeBase->Base_End();
01151    }
01152    return Dummy::BaseCont().end();
01153 }
01154 
01155 
01156 //-------------------------------------------------------------------------------
01157 inline Reflex::Reverse_Base_Iterator
01158 Reflex::Scope::Base_RBegin() const {
01159 //-------------------------------------------------------------------------------
01160    if (*this) {
01161       return fScopeName->fScopeBase->Base_RBegin();
01162    }
01163    return Dummy::BaseCont().rbegin();
01164 }
01165 
01166 
01167 //-------------------------------------------------------------------------------
01168 inline Reflex::Reverse_Base_Iterator
01169 Reflex::Scope::Base_REnd() const {
01170 //-------------------------------------------------------------------------------
01171    if (*this) {
01172       return fScopeName->fScopeBase->Base_REnd();
01173    }
01174    return Dummy::BaseCont().rend();
01175 }
01176 
01177 
01178 //-------------------------------------------------------------------------------
01179 inline Reflex::Member_Iterator
01180 Reflex::Scope::DataMember_Begin(EMEMBERQUERY inh) const {
01181 //-------------------------------------------------------------------------------
01182    if (*this) {
01183       return fScopeName->fScopeBase->DataMember_Begin(inh);
01184    }
01185    return Dummy::MemberCont().begin();
01186 }
01187 
01188 
01189 //-------------------------------------------------------------------------------
01190 inline Reflex::Member_Iterator
01191 Reflex::Scope::DataMember_End(EMEMBERQUERY inh) const {
01192 //-------------------------------------------------------------------------------
01193    if (*this) {
01194       return fScopeName->fScopeBase->DataMember_End(inh);
01195    }
01196    return Dummy::MemberCont().end();
01197 }
01198 
01199 
01200 //-------------------------------------------------------------------------------
01201 inline Reflex::Reverse_Member_Iterator
01202 Reflex::Scope::DataMember_RBegin(EMEMBERQUERY inh) const {
01203 //-------------------------------------------------------------------------------
01204    if (*this) {
01205       return fScopeName->fScopeBase->DataMember_RBegin(inh);
01206    }
01207    return Dummy::MemberCont().rbegin();
01208 }
01209 
01210 
01211 //-------------------------------------------------------------------------------
01212 inline Reflex::Reverse_Member_Iterator
01213 Reflex::Scope::DataMember_REnd(EMEMBERQUERY inh) const {
01214 //-------------------------------------------------------------------------------
01215    if (*this) {
01216       return fScopeName->fScopeBase->DataMember_REnd(inh);
01217    }
01218    return Dummy::MemberCont().rend();
01219 }
01220 
01221 
01222 //-------------------------------------------------------------------------------
01223 inline Reflex::Scope
01224 Reflex::Scope::DeclaringScope() const {
01225 //-------------------------------------------------------------------------------
01226    if (*this) {
01227       return fScopeName->fScopeBase->DeclaringScope();
01228    }
01229    return Dummy::Scope();
01230 }
01231 
01232 
01233 //-------------------------------------------------------------------------------
01234 inline Reflex::Member_Iterator
01235 Reflex::Scope::FunctionMember_Begin(EMEMBERQUERY inh) const {
01236 //-------------------------------------------------------------------------------
01237    if (*this) {
01238       return fScopeName->fScopeBase->FunctionMember_Begin(inh);
01239    }
01240    return Dummy::MemberCont().begin();
01241 }
01242 
01243 
01244 //-------------------------------------------------------------------------------
01245 inline Reflex::Member_Iterator
01246 Reflex::Scope::FunctionMember_End(EMEMBERQUERY inh) const {
01247 //-------------------------------------------------------------------------------
01248    if (*this) {
01249       return fScopeName->fScopeBase->FunctionMember_End(inh);
01250    }
01251    return Dummy::MemberCont().end();
01252 }
01253 
01254 
01255 //-------------------------------------------------------------------------------
01256 inline Reflex::Reverse_Member_Iterator
01257 Reflex::Scope::FunctionMember_RBegin(EMEMBERQUERY inh) const {
01258 //-------------------------------------------------------------------------------
01259    if (*this) {
01260       return fScopeName->fScopeBase->FunctionMember_RBegin(inh);
01261    }
01262    return Dummy::MemberCont().rbegin();
01263 }
01264 
01265 
01266 //-------------------------------------------------------------------------------
01267 inline Reflex::Reverse_Member_Iterator
01268 Reflex::Scope::FunctionMember_REnd(EMEMBERQUERY inh) const {
01269 //-------------------------------------------------------------------------------
01270    if (*this) {
01271       return fScopeName->fScopeBase->FunctionMember_REnd(inh);
01272    }
01273    return Dummy::MemberCont().rend();
01274 }
01275 
01276 
01277 //-------------------------------------------------------------------------------
01278 inline Reflex::Scope
01279 Reflex::Scope::GlobalScope() {
01280 //-------------------------------------------------------------------------------
01281    return ScopeBase::GlobalScope();
01282 }
01283 
01284 
01285 //-------------------------------------------------------------------------------
01286 inline void*
01287 Reflex::Scope::Id() const {
01288 //-------------------------------------------------------------------------------
01289    return (void*) fScopeName;
01290 }
01291 
01292 
01293 //-------------------------------------------------------------------------------
01294 inline bool
01295 Reflex::Scope::IsClass() const {
01296 //-------------------------------------------------------------------------------
01297    if (*this) {
01298       return fScopeName->fScopeBase->IsClass();
01299    }
01300    return false;
01301 }
01302 
01303 
01304 //-------------------------------------------------------------------------------
01305 inline bool
01306 Reflex::Scope::IsEnum() const {
01307 //-------------------------------------------------------------------------------
01308    if (*this) {
01309       return fScopeName->fScopeBase->IsEnum();
01310    }
01311    return false;
01312 }
01313 
01314 
01315 //-------------------------------------------------------------------------------
01316 inline bool
01317 Reflex::Scope::IsNamespace() const {
01318 //-------------------------------------------------------------------------------
01319    if (*this) {
01320       return fScopeName->fScopeBase->IsNamespace();
01321    }
01322    return false;
01323 }
01324 
01325 
01326 //-------------------------------------------------------------------------------
01327 inline bool
01328 Reflex::Scope::IsTemplateInstance() const {
01329 //-------------------------------------------------------------------------------
01330    if (*this) {
01331       return fScopeName->fScopeBase->IsTemplateInstance();
01332    }
01333    return false;
01334 }
01335 
01336 
01337 //-------------------------------------------------------------------------------
01338 inline bool
01339 Reflex::Scope::IsTopScope() const {
01340 //-------------------------------------------------------------------------------
01341    if (*this) {
01342       return fScopeName->fScopeBase->IsTopScope();
01343    }
01344    return false;
01345 }
01346 
01347 
01348 //-------------------------------------------------------------------------------
01349 inline bool
01350 Reflex::Scope::IsUnion() const {
01351 //-------------------------------------------------------------------------------
01352    if (*this) {
01353       return fScopeName->fScopeBase->IsUnion();
01354    }
01355    return false;
01356 }
01357 
01358 
01359 //-------------------------------------------------------------------------------
01360 inline size_t
01361 Reflex::Scope::MemberSize(EMEMBERQUERY inh) const {
01362 //-------------------------------------------------------------------------------
01363    if (*this) {
01364       return fScopeName->fScopeBase->MemberSize(inh);
01365    }
01366    return 0;
01367 }
01368 
01369 
01370 //-------------------------------------------------------------------------------
01371 inline Reflex::MemberTemplate_Iterator
01372 Reflex::Scope::MemberTemplate_Begin() const {
01373 //-------------------------------------------------------------------------------
01374    if (*this) {
01375       return fScopeName->fScopeBase->MemberTemplate_Begin();
01376    }
01377    return Dummy::MemberTemplateCont().begin();
01378 }
01379 
01380 
01381 //-------------------------------------------------------------------------------
01382 inline Reflex::MemberTemplate_Iterator
01383 Reflex::Scope::MemberTemplate_End() const {
01384 //-------------------------------------------------------------------------------
01385    if (*this) {
01386       return fScopeName->fScopeBase->MemberTemplate_End();
01387    }
01388    return Dummy::MemberTemplateCont().end();
01389 }
01390 
01391 
01392 //-------------------------------------------------------------------------------
01393 inline Reflex::Reverse_MemberTemplate_Iterator
01394 Reflex::Scope::MemberTemplate_RBegin() const {
01395 //-------------------------------------------------------------------------------
01396    if (*this) {
01397       return fScopeName->fScopeBase->MemberTemplate_RBegin();
01398    }
01399    return Dummy::MemberTemplateCont().rbegin();
01400 }
01401 
01402 
01403 //-------------------------------------------------------------------------------
01404 inline Reflex::Reverse_MemberTemplate_Iterator
01405 Reflex::Scope::MemberTemplate_REnd() const {
01406 //-------------------------------------------------------------------------------
01407    if (*this) {
01408       return fScopeName->fScopeBase->MemberTemplate_REnd();
01409    }
01410    return Dummy::MemberTemplateCont().rend();
01411 }
01412 
01413 
01414 //-------------------------------------------------------------------------------
01415 inline const char*
01416 Reflex::Scope::Name_c_str() const {
01417 //-------------------------------------------------------------------------------
01418    if (fScopeName) {
01419       return fScopeName->Name();
01420    }
01421    return "";
01422 }
01423 
01424 
01425 //-------------------------------------------------------------------------------
01426 inline Reflex::PropertyList
01427 Reflex::Scope::Properties() const {
01428 //-------------------------------------------------------------------------------
01429    if (*this) {
01430       return fScopeName->fScopeBase->Properties();
01431    }
01432    return Dummy::PropertyList();
01433 }
01434 
01435 
01436 //-------------------------------------------------------------------------------
01437 inline Reflex::TYPE
01438 Reflex::Scope::ScopeType() const {
01439 //-------------------------------------------------------------------------------
01440    if (*this) {
01441       return fScopeName->fScopeBase->ScopeType();
01442    }
01443    return UNRESOLVED;
01444 }
01445 
01446 
01447 //-------------------------------------------------------------------------------
01448 inline std::string
01449 Reflex::Scope::ScopeTypeAsString() const {
01450 //-------------------------------------------------------------------------------
01451    if (*this) {
01452       return fScopeName->fScopeBase->ScopeTypeAsString();
01453    }
01454    return "UNRESOLVED";
01455 }
01456 
01457 
01458 //-------------------------------------------------------------------------------
01459 inline Reflex::Scope_Iterator
01460 Reflex::Scope::Scope_Begin() {
01461 //-------------------------------------------------------------------------------
01462    return ScopeName::Scope_Begin();
01463 }
01464 
01465 
01466 //-------------------------------------------------------------------------------
01467 inline Reflex::Scope_Iterator
01468 Reflex::Scope::Scope_End() {
01469 //-------------------------------------------------------------------------------
01470    return ScopeName::Scope_End();
01471 }
01472 
01473 
01474 //-------------------------------------------------------------------------------
01475 inline Reflex::Reverse_Scope_Iterator
01476 Reflex::Scope::Scope_RBegin() {
01477 //-------------------------------------------------------------------------------
01478    return ScopeName::Scope_RBegin();
01479 }
01480 
01481 
01482 //-------------------------------------------------------------------------------
01483 inline Reflex::Reverse_Scope_Iterator
01484 Reflex::Scope::Scope_REnd() {
01485 //-------------------------------------------------------------------------------
01486    return ScopeName::Scope_REnd();
01487 }
01488 
01489 
01490 //-------------------------------------------------------------------------------
01491 inline Reflex::Scope
01492 Reflex::Scope::SubScopeAt(size_t nth) const {
01493 //-------------------------------------------------------------------------------
01494    if (*this) {
01495       return fScopeName->fScopeBase->SubScopeAt(nth);
01496    }
01497    return Dummy::Scope();
01498 }
01499 
01500 
01501 //-------------------------------------------------------------------------------
01502 inline size_t
01503 Reflex::Scope::SubScopeLevel() const {
01504 //-------------------------------------------------------------------------------
01505    if (*this) {
01506       return fScopeName->fScopeBase->SubScopeLevel();
01507    }
01508    return 0;
01509 }
01510 
01511 
01512 //-------------------------------------------------------------------------------
01513 inline size_t
01514 Reflex::Scope::SubScopeSize() const {
01515 //-------------------------------------------------------------------------------
01516    if (*this) {
01517       return fScopeName->fScopeBase->SubScopeSize();
01518    }
01519    return 0;
01520 }
01521 
01522 
01523 //-------------------------------------------------------------------------------
01524 inline Reflex::Scope
01525 Reflex::Scope::SubScopeByName(const std::string& nam) const {
01526 //-------------------------------------------------------------------------------
01527    if (*this) {
01528       return fScopeName->fScopeBase->SubScopeByName(nam);
01529    }
01530    return Dummy::Scope();
01531 }
01532 
01533 
01534 //-------------------------------------------------------------------------------
01535 inline Reflex::Scope_Iterator
01536 Reflex::Scope::SubScope_Begin() const {
01537 //-------------------------------------------------------------------------------
01538    if (*this) {
01539       return fScopeName->fScopeBase->SubScope_Begin();
01540    }
01541    return Dummy::ScopeCont().begin();
01542 }
01543 
01544 
01545 //-------------------------------------------------------------------------------
01546 inline Reflex::Scope_Iterator
01547 Reflex::Scope::SubScope_End() const {
01548 //-------------------------------------------------------------------------------
01549    if (*this) {
01550       return fScopeName->fScopeBase->SubScope_End();
01551    }
01552    return Dummy::ScopeCont().end();
01553 }
01554 
01555 
01556 //-------------------------------------------------------------------------------
01557 inline Reflex::Reverse_Scope_Iterator
01558 Reflex::Scope::SubScope_RBegin() const {
01559 //-------------------------------------------------------------------------------
01560    if (*this) {
01561       return fScopeName->fScopeBase->SubScope_RBegin();
01562    }
01563    return Dummy::ScopeCont().rbegin();
01564 }
01565 
01566 
01567 //-------------------------------------------------------------------------------
01568 inline Reflex::Reverse_Scope_Iterator
01569 Reflex::Scope::SubScope_REnd() const {
01570 //-------------------------------------------------------------------------------
01571    if (*this) {
01572       return fScopeName->fScopeBase->SubScope_REnd();
01573    }
01574    return Dummy::ScopeCont().rend();
01575 }
01576 
01577 
01578 //-------------------------------------------------------------------------------
01579 inline Reflex::Type_Iterator
01580 Reflex::Scope::SubType_Begin() const {
01581 //-------------------------------------------------------------------------------
01582    if (*this) {
01583       return fScopeName->fScopeBase->SubType_Begin();
01584    }
01585    return Dummy::TypeCont().begin();
01586 }
01587 
01588 
01589 //-------------------------------------------------------------------------------
01590 inline Reflex::Type_Iterator
01591 Reflex::Scope::SubType_End() const {
01592 //-------------------------------------------------------------------------------
01593    if (*this) {
01594       return fScopeName->fScopeBase->SubType_End();
01595    }
01596    return Dummy::TypeCont().end();
01597 }
01598 
01599 
01600 //-------------------------------------------------------------------------------
01601 inline Reflex::Reverse_Type_Iterator
01602 Reflex::Scope::SubType_RBegin() const {
01603 //-------------------------------------------------------------------------------
01604    if (*this) {
01605       return fScopeName->fScopeBase->SubType_RBegin();
01606    }
01607    return Dummy::TypeCont().rbegin();
01608 }
01609 
01610 
01611 //-------------------------------------------------------------------------------
01612 inline Reflex::Reverse_Type_Iterator
01613 Reflex::Scope::SubType_REnd() const {
01614 //-------------------------------------------------------------------------------
01615    if (*this) {
01616       return fScopeName->fScopeBase->SubType_REnd();
01617    }
01618    return Dummy::TypeCont().rend();
01619 }
01620 
01621 
01622 //-------------------------------------------------------------------------------
01623 inline const Reflex::ScopeBase*
01624 Reflex::Scope::ToScopeBase() const {
01625 //-------------------------------------------------------------------------------
01626    if (*this) {
01627       return fScopeName->fScopeBase;
01628    }
01629    return 0;
01630 }
01631 
01632 
01633 //-------------------------------------------------------------------------------
01634 inline Reflex::TypeTemplate_Iterator
01635 Reflex::Scope::SubTypeTemplate_Begin() const {
01636 //-------------------------------------------------------------------------------
01637    if (*this) {
01638       return fScopeName->fScopeBase->SubTypeTemplate_Begin();
01639    }
01640    return Dummy::TypeTemplateCont().begin();
01641 }
01642 
01643 
01644 //-------------------------------------------------------------------------------
01645 inline Reflex::TypeTemplate_Iterator
01646 Reflex::Scope::SubTypeTemplate_End() const {
01647 //-------------------------------------------------------------------------------
01648    if (*this) {
01649       return fScopeName->fScopeBase->SubTypeTemplate_End();
01650    }
01651    return Dummy::TypeTemplateCont().end();
01652 }
01653 
01654 
01655 //-------------------------------------------------------------------------------
01656 inline Reflex::Reverse_TypeTemplate_Iterator
01657 Reflex::Scope::SubTypeTemplate_RBegin() const {
01658 //-------------------------------------------------------------------------------
01659    if (*this) {
01660       return fScopeName->fScopeBase->SubTypeTemplate_RBegin();
01661    }
01662    return Dummy::TypeTemplateCont().rbegin();
01663 }
01664 
01665 
01666 //-------------------------------------------------------------------------------
01667 inline Reflex::Reverse_TypeTemplate_Iterator
01668 Reflex::Scope::SubTypeTemplate_REnd() const {
01669 //-------------------------------------------------------------------------------
01670    if (*this) {
01671       return fScopeName->fScopeBase->SubTypeTemplate_REnd();
01672    }
01673    return Dummy::TypeTemplateCont().rend();
01674 }
01675 
01676 
01677 //-------------------------------------------------------------------------------
01678 inline Reflex::Scope
01679 Reflex::Scope::UsingDirectiveAt(size_t nth) const {
01680 //-------------------------------------------------------------------------------
01681    if (*this) {
01682       return fScopeName->fScopeBase->UsingDirectiveAt(nth);
01683    }
01684    return Dummy::Scope();
01685 }
01686 
01687 
01688 //-------------------------------------------------------------------------------
01689 inline size_t
01690 Reflex::Scope::UsingDirectiveSize() const {
01691 //-------------------------------------------------------------------------------
01692    if (*this) {
01693       return fScopeName->fScopeBase->UsingDirectiveSize();
01694    }
01695    return 0;
01696 }
01697 
01698 
01699 //-------------------------------------------------------------------------------
01700 inline Reflex::Scope_Iterator
01701 Reflex::Scope::UsingDirective_Begin() const {
01702 //-------------------------------------------------------------------------------
01703    if (*this) {
01704       return fScopeName->fScopeBase->UsingDirective_Begin();
01705    }
01706    return Dummy::ScopeCont().begin();
01707 }
01708 
01709 
01710 //-------------------------------------------------------------------------------
01711 inline Reflex::Scope_Iterator
01712 Reflex::Scope::UsingDirective_End() const {
01713 //-------------------------------------------------------------------------------
01714    if (*this) {
01715       return fScopeName->fScopeBase->UsingDirective_End();
01716    }
01717    return Dummy::ScopeCont().end();
01718 }
01719 
01720 
01721 //-------------------------------------------------------------------------------
01722 inline Reflex::Reverse_Scope_Iterator
01723 Reflex::Scope::UsingDirective_RBegin() const {
01724 //-------------------------------------------------------------------------------
01725    if (*this) {
01726       return fScopeName->fScopeBase->UsingDirective_RBegin();
01727    }
01728    return Dummy::ScopeCont().rbegin();
01729 }
01730 
01731 
01732 //-------------------------------------------------------------------------------
01733 inline Reflex::Reverse_Scope_Iterator
01734 Reflex::Scope::UsingDirective_REnd() const {
01735 //-------------------------------------------------------------------------------
01736    if (*this) {
01737       return fScopeName->fScopeBase->UsingDirective_REnd();
01738    }
01739    return Dummy::ScopeCont().rend();
01740 }
01741 
01742 
01743 //-------------------------------------------------------------------------------
01744 inline void
01745 Reflex::Scope::AddBase(const Type& bas,
01746                        OffsetFunction offsFP,
01747                        unsigned int modifiers /* = 0 */) const {
01748 //-------------------------------------------------------------------------------
01749    if (*this) {
01750       fScopeName->fScopeBase->AddBase(bas, offsFP, modifiers);
01751    }
01752 }
01753 
01754 
01755 //-------------------------------------------------------------------------------
01756 inline void
01757 Reflex::Scope::AddBase(const Base& b) const {
01758 //-------------------------------------------------------------------------------
01759    if (*this) {
01760       fScopeName->fScopeBase->AddBase(b);
01761    }
01762 }
01763 
01764 
01765 //-------------------------------------------------------------------------------
01766 inline void
01767 Reflex::Scope::AddSubScope(const Scope& sc) const {
01768 //-------------------------------------------------------------------------------
01769    if (*this) {
01770       fScopeName->fScopeBase->AddSubScope(sc);
01771    }
01772 }
01773 
01774 
01775 //-------------------------------------------------------------------------------
01776 inline void
01777 Reflex::Scope::AddSubScope(const char* scope,
01778                            TYPE scopeType) const {
01779 //-------------------------------------------------------------------------------
01780    if (*this) {
01781       fScopeName->fScopeBase->AddSubScope(scope, scopeType);
01782    }
01783 }
01784 
01785 
01786 //-------------------------------------------------------------------------------
01787 inline void
01788 Reflex::Scope::RemoveSubScope(const Scope& sc) const {
01789 //-------------------------------------------------------------------------------
01790    if (*this) {
01791       fScopeName->fScopeBase->RemoveSubScope(sc);
01792    }
01793 }
01794 
01795 
01796 //-------------------------------------------------------------------------------
01797 inline void
01798 Reflex::Scope::AddUsingDirective(const Scope& ud) const {
01799 //-------------------------------------------------------------------------------
01800    if (*this) {
01801       fScopeName->fScopeBase->AddUsingDirective(ud);
01802    }
01803 }
01804 
01805 
01806 //-------------------------------------------------------------------------------
01807 inline void
01808 Reflex::Scope::RemoveUsingDirective(const Scope& ud) const {
01809 //-------------------------------------------------------------------------------
01810    if (*this) {
01811       fScopeName->fScopeBase->RemoveUsingDirective(ud);
01812    }
01813 }
01814 
01815 
01816 #ifdef REFLEX_CINT_MERGE
01817 inline bool
01818 operator &&(bool b,
01819             const Reflex::Scope& rh) {
01820    return b && rh.operator bool();
01821 }
01822 
01823 
01824 inline bool
01825 operator &&(int i,
01826             const Reflex::Scope& rh) {
01827    return i && rh.operator bool();
01828 }
01829 
01830 
01831 inline bool
01832 operator ||(bool b,
01833             const Reflex::Scope& rh) {
01834    return b || rh.operator bool();
01835 }
01836 
01837 
01838 inline bool
01839 operator ||(int i,
01840             const Reflex::Scope& rh) {
01841    return i || rh.operator bool();
01842 }
01843 
01844 
01845 inline bool
01846 operator &&(char* c,
01847             const Reflex::Scope& rh) {
01848    return c && rh.operator bool();
01849 }
01850 
01851 
01852 inline bool
01853 operator ||(char* c,
01854             const Reflex::Scope& rh) {
01855    return c || rh.operator bool();
01856 }
01857 
01858 #endif
01859 
01860 #endif // Reflex_Scope

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