ATLAS Offline Software
Loading...
Searching...
No Matches
SG::BaseInfoBase Class Reference

The non-template portion of the BaseInfo implementation. More...

#include <BaseInfo.h>

Collaboration diagram for SG::BaseInfoBase:

Public Types

using destroy_fn = void (void*)
typedef void * castfn_t(void *p)
 Type of a pointer conversion function.
typedef void init_func_t(BaseInfoBase *bib)
 Type for an initialization function.

Public Member Functions

CLID clid () const
 Return the CLID for this class.
const std::type_info & typeinfo () const
 Return the std::type_info for this class.
void * cast (void *p, CLID clid) const
 Cast to a base pointer.
void * cast (void *p, const std::type_info &tinfo) const
 Cast to a base pointer.
void * castTo (void *p, CLID clid) const
 Cast to a derived pointer.
void * castTo (void *p, const std::type_info &tinfo) const
 Cast to a derived pointer.
castfn_t * castfn (CLID clid) const
 Return a function for casting to a base pointer.
castfn_t * castfn (const std::type_info &tinfo) const
 Return a function for casting to a base pointer.
castfn_t * castfnTo (CLID clid) const
 Return a function for casting to a derived pointer.
castfn_t * castfnTo (const std::type_info &tinfo) const
 Return a function for casting to a derived pointer.
const std::vector< CLID > & get_bases () const
 Return the class IDs of all known bases of T (that have class IDs).
std::vector< const std::type_info * > get_ti_bases () const
 Return the type_info's of all known bases of T.
bool is_base (CLID clid) const
 Return true if clid is the ID of a class that is known to be a base of T.
bool is_base (const std::type_info &tinfo) const
 Return true if tinfo is the type_info of a class that is known to be a base of T.
bool is_virtual (CLID clid) const
 Return true if clid is the ID of a class that is known to be a virtual base of T.
bool is_virtual (const std::type_info &tinfo) const
 Return true if tinfo is the std::type_info of a class that is known to be a virtual base of T.
const CopyConversionBase * copy_conversion (const std::type_info &tinfo) const
 Search for a copy conversion to tinfo.
const CopyConversionBase * copy_conversion (CLID clid) const
 Search for a copy conversion to clid.
void destroy (void *p) const
 Delete an instance of the described type.
void add_copy_conversion (const std::type_info &tinfo, const CopyConversionBase *cnv)
 Add a new copy conversion.
std::vector< CLID > get_copy_conversions () const
 Return known copy conversions.
void add_info (const std::type_info &tinfo, castfn_t *converter, castfn_t *converterTo, bool is_virtual)
 Add information about one base class.
void maybeInit ()
 Run initializations for this class, if needed.

Static Public Member Functions

static const BaseInfoBase * find (CLID clid)
 Find the BaseInfoBase instance for clid.
static const BaseInfoBase * find (const std::type_info &tinfo)
 Find the BaseInfoBase instance for tinfo.
static void addInit (const std::type_info *tinfo, init_func_t *init_func)
 Register an initialization function.

Protected Member Functions

 BaseInfoBase (const std::type_info &tinfo, destroy_fn *destroy)
 Constructor.
 ~BaseInfoBase ()
 Destructor.

Private Member Functions

 BaseInfoBase (const BaseInfoBase &)
BaseInfoBase & operator= (const BaseInfoBase &)

Static Private Member Functions

static BaseInfoBase * find1 (const std::type_info &tinfo)
 Helper for find.

Private Attributes

BaseInfoBaseImpl * m_impl
 Pointer to internal state.

Friends

template<class D, class B>
struct RegisterAddBaseInit
template<class D, class B>
struct RegisterAddCopyConversionInit

Detailed Description

The non-template portion of the BaseInfo implementation.

Definition at line 457 of file Control/AthenaKernel/AthenaKernel/BaseInfo.h.

Member Typedef Documentation

◆ castfn_t

typedef void * SG::BaseInfoBase::castfn_t(void *p)

Type of a pointer conversion function.

Definition at line 526 of file Control/AthenaKernel/AthenaKernel/BaseInfo.h.

◆ destroy_fn

using SG::BaseInfoBase::destroy_fn = void (void*)

◆ init_func_t

typedef void SG::BaseInfoBase::init_func_t(BaseInfoBase *bib)

Type for an initialization function.

Definition at line 701 of file Control/AthenaKernel/AthenaKernel/BaseInfo.h.

Constructor & Destructor Documentation

◆ BaseInfoBase() [1/2]

SG::BaseInfoBase::BaseInfoBase ( const std::type_info & tinfo,
destroy_fn * destroy )
protected

Constructor.

Parameters
tinfoThe std::type_info for this class.
destroyDestruction function for this class.
tinfoThe std::type_info for this class.

Definition at line 544 of file BaseInfo.cxx.

546 : m_impl (new BaseInfoBaseImpl)
547{
548 m_impl->m_clid = CLIDRegistry::typeinfoToCLID (tinfo);
549 m_impl->m_typeinfo = &tinfo;
550 m_impl->m_destroy = destroy;
551 m_impl->m_needs_init = true;
552
553 BaseInfoBaseImpl::lock_t lock (BaseInfoBaseImpl::s_mutex);
554 if (!BaseInfoBaseImpl::s_bi_by_ti)
555 BaseInfoBaseImpl::s_bi_by_ti = new BaseInfoBaseImpl::bi_by_ti_map_type;
556 if (!BaseInfoBaseImpl::s_ti_by_name)
557 BaseInfoBaseImpl::s_ti_by_name = new BaseInfoBaseImpl::ti_by_name_map_type;
558
559 // Register this instance in the static maps.
560 (*BaseInfoBaseImpl::s_bi_by_ti)[&tinfo] = this;
561 (*BaseInfoBaseImpl::s_ti_by_name)[tinfo.name()] = &tinfo;
562}
static CLID typeinfoToCLID(const std::type_info &ti)
Return the CLID corresponding to a type_info.
void destroy(void *p) const
Delete an instance of the described type.
Definition BaseInfo.cxx:439
BaseInfoBaseImpl * m_impl
Pointer to internal state.
virtual void lock() override
Lock the container.
std::lock_guard< mutex_t > lock_t
Definition BaseInfo.cxx:104
std::unordered_map< std::string, const std::type_info * > ti_by_name_map_type
Used to canonicalize type_info instances.
Definition BaseInfo.cxx:83
std::unordered_map< const std::type_info *, BaseInfoBase * > bi_by_ti_map_type
Map of all type_info pointers to BaseInfoBase instances.
Definition BaseInfo.cxx:78

◆ ~BaseInfoBase()

SG::BaseInfoBase::~BaseInfoBase ( )
protected

Destructor.

Definition at line 568 of file BaseInfo.cxx.

569{
570 for (BaseInfoBaseImpl::ti_copyconversion_type::iterator it =
571 m_impl->m_ti_copyconversion_map.begin();
572 it != m_impl->m_ti_copyconversion_map.end();
573 ++it)
574 {
575 delete it->second;
576 }
577 delete m_impl;
578}

◆ BaseInfoBase() [2/2]

SG::BaseInfoBase::BaseInfoBase ( const BaseInfoBase & )
private

Member Function Documentation

◆ add_copy_conversion()

void SG::BaseInfoBase::add_copy_conversion ( const std::type_info & tinfo,
const CopyConversionBase * cnv )

Add a new copy conversion.

Parameters
tinfoThe std::type_info of the target class.
cnvA CopyConversionBase instance describing the conversion.

The BaseInfoBase takes ownership of the cnv object.

Definition at line 455 of file BaseInfo.cxx.

457{
459 m_impl->m_ti_copyconversion_map.emplace_back (&tinfo, cnv);
460}

◆ add_info()

void SG::BaseInfoBase::add_info ( const std::type_info & tinfo,
castfn_t * converter,
castfn_t * converterTo,
bool is_virtual )

Add information about one base class.

Parameters
tinfoThe std::type_info of the base.
converterConverter function. This should be able to convert a T* to a pointer to this base.
converterToConverter function. This should be able to convert a pointer to this base to a T*.
is_virtualTrue if the derivation from this base to T is via virtual derivation.

Definition at line 494 of file BaseInfo.cxx.

498{
499 BaseInfoBaseImpl::lock_t slock (BaseInfoBaseImpl::s_mutex);
501 {
502 const BaseInfoBaseImpl::info* i = m_impl->findInfo (tinfo);
503 if (!i) {
504 m_impl->m_timap.emplace_back (&tinfo,
505 BaseInfoBaseImpl::info (converter, converterTo, is_virtual));
506 }
507 }
508
509 auto i = BaseInfoBaseImpl::s_bi_by_ti->find (&tinfo);
510 if (i != BaseInfoBaseImpl::s_bi_by_ti->end()) {
511 BaseInfoBaseImpl& impl = *i->second->m_impl;
512 if (impl.m_clid == CLID_NULL)
513 impl.m_clid = CLIDRegistry::typeinfoToCLID (tinfo);
514 }
515}
bool is_virtual(CLID clid) const
Return true if clid is the ID of a class that is known to be a virtual base of T.
Definition BaseInfo.cxx:376

◆ addInit()

void SG::BaseInfoBase::addInit ( const std::type_info * tinfo,
init_func_t * init_func )
static

Register an initialization function.

Parameters
tinfoThe std::type_info for the class being registered.
init_funcFunction to initialize BaseInfo for the class.

Definition at line 690 of file BaseInfo.cxx.

692{
693 BaseInfoBaseImpl::lock_t lock (BaseInfoBaseImpl::s_mutex);
694 if (!BaseInfoBaseImpl::s_init_list)
695 BaseInfoBaseImpl::s_init_list =
697 BaseInfoBaseImpl::s_init_list->insert (std::make_pair (tinfo, init_func));
698
699 if (BaseInfoBaseImpl::s_bi_by_ti) {
700 auto i = BaseInfoBaseImpl::s_bi_by_ti->find (tinfo);
701 if (i != BaseInfoBaseImpl::s_bi_by_ti->end()) {
702 BaseInfoBaseImpl::lock_t lock (i->second->m_impl->m_mutex);
703 BaseInfoBaseImpl& impl = *i->second->m_impl;
704 impl.m_needs_init = true;
705 if (impl.m_clid == CLID_NULL)
706 impl.m_clid = CLIDRegistry::typeinfoToCLID (*tinfo);
707 }
708 }
709}
std::unordered_multimap< const std::type_info *, BaseInfoBase::init_func_t * > init_list_t
Holds BaseInfo classes awaiting initialization.
Definition BaseInfo.cxx:90

◆ cast() [1/2]

void * SG::BaseInfoBase::cast ( void * p,
CLID clid ) const

Cast to a base pointer.

Parameters
pThe pointer to cast (a T* cast to a void*).
clidID of the class to which to cast.
Returns
The pointer cast to the requested type, returned as a void*. clid must be known to be a base of T; otherwise, 0 will be returned.

Definition at line 169 of file BaseInfo.cxx.

170{
171 const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
172 if (ti)
173 return this->cast (p, *ti);
174 return 0;
175}
static const std::type_info * CLIDToTypeinfo(CLID clid)
Translate between CLID and type_info.
CLID clid() const
Return the CLID for this class.
Definition BaseInfo.cxx:144
void * cast(void *p, CLID clid) const
Cast to a base pointer.
Definition BaseInfo.cxx:169

◆ cast() [2/2]

void * SG::BaseInfoBase::cast ( void * p,
const std::type_info & tinfo ) const

Cast to a base pointer.

Parameters
pThe pointer to cast (a T* cast to a void*).
clidtype_info of the class to which to cast.
Returns
The pointer cast to the requested type, returned as a void*. tinfo must be known to be a base of T; otherwise, 0 will be returned.

Definition at line 186 of file BaseInfo.cxx.

187{
188 if (BaseInfoBase::castfn_t* converter = castfn (tinfo)) {
189 return converter (p);
190 }
191 return nullptr;
192}
castfn_t * castfn(CLID clid) const
Return a function for casting to a base pointer.
Definition BaseInfo.cxx:239
void * castfn_t(void *p)
Type of a pointer conversion function.

◆ castfn() [1/2]

BaseInfoBase::castfn_t * SG::BaseInfoBase::castfn ( CLID clid) const

Return a function for casting to a base pointer.

Parameters
clidID of the class to which to cast.
Returns
A function to convert a pointer to a T to a pointer to the type identified by clid. clid must be known to be a base of T; otherwise, 0 will be returned.

Definition at line 239 of file BaseInfo.cxx.

240{
241 const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
242 if (ti)
243 return this->castfn (*ti);
244 return 0;
245}

◆ castfn() [2/2]

BaseInfoBase::castfn_t * SG::BaseInfoBase::castfn ( const std::type_info & tinfo) const

Return a function for casting to a base pointer.

Parameters
clidtype_info of the class to which to cast.
Returns
A function to convert a pointer to a T to a pointer to the type identified by tinfo. tinfo must be known to be a base of T; otherwise, 0 will be returned.

Definition at line 257 of file BaseInfo.cxx.

258{
260 const BaseInfoBaseImpl::info* i = m_impl->findInfo (tinfo);
261 if (i)
262 return i->m_converter;
263 return nullptr;
264}

◆ castfnTo() [1/2]

BaseInfoBase::castfn_t * SG::BaseInfoBase::castfnTo ( CLID clid) const

Return a function for casting to a derived pointer.

Parameters
clidID of the class B from which to cast.
Returns
A function to convert a pointer to a B to a pointer to a T. B must be known to be a base of T; otherwise, 0 will be returned. 0 will also be returned if the dynamic_cast fails.

Definition at line 275 of file BaseInfo.cxx.

276{
277 const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
278 if (ti)
279 return this->castfnTo (*ti);
280 return 0;
281}
castfn_t * castfnTo(CLID clid) const
Return a function for casting to a derived pointer.
Definition BaseInfo.cxx:275

◆ castfnTo() [2/2]

BaseInfoBase::castfn_t * SG::BaseInfoBase::castfnTo ( const std::type_info & tinfo) const

Return a function for casting to a derived pointer.

Parameters
clidtype_info of the class B from which to cast.
Returns
A function to convert a pointer to a B to a pointer to a T. B must be known to be a base of T; otherwise, 0 will be returned. 0 will also be returned if the dynamic_cast fails.

Definition at line 293 of file BaseInfo.cxx.

294{
296 const BaseInfoBaseImpl::info* i = m_impl->findInfo (tinfo);
297 if (i)
298 return i->m_converterTo;
299 return nullptr;
300}

◆ castTo() [1/2]

void * SG::BaseInfoBase::castTo ( void * p,
CLID clid ) const

Cast to a derived pointer.

Parameters
pThe pointer to cast (a B* cast to a void*).
clidID of the class B from which to cast.
Returns
The pointer cast to the requested type, returned as a void*. clid must be known to be a base of T; otherwise, 0 will be returned. 0 will also be returned if the dynamic_cast fails.

Definition at line 204 of file BaseInfo.cxx.

205{
206 const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
207 if (ti)
208 return this->castTo (p, *ti);
209 return 0;
210}
void * castTo(void *p, CLID clid) const
Cast to a derived pointer.
Definition BaseInfo.cxx:204

◆ castTo() [2/2]

void * SG::BaseInfoBase::castTo ( void * p,
const std::type_info & tinfo ) const

Cast to a derived pointer.

Parameters
pThe pointer to cast (a B* cast to a void*).
clidtype_info of the class B from which to cast.
Returns
The pointer cast to the requested type, returned as a void*. tinfo must be known to be a base of T; otherwise, 0 will be returned. 0 will also be returned if the dynamic_cast fails.

Definition at line 222 of file BaseInfo.cxx.

223{
224 if (BaseInfoBase::castfn_t* converterTo = castfnTo (tinfo)) {
225 return converterTo (p);
226 }
227 return nullptr;
228}

◆ clid()

CLID SG::BaseInfoBase::clid ( ) const

Return the CLID for this class.

Definition at line 144 of file BaseInfo.cxx.

145{
147 return m_impl->m_clid;
148}

◆ copy_conversion() [1/2]

const CopyConversionBase * SG::BaseInfoBase::copy_conversion ( CLID clid) const

Search for a copy conversion to clid.

Parameters
clidThe class to which we want to convert.

Returns the conversion instance or 0.

Definition at line 426 of file BaseInfo.cxx.

427{
428 const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
429 if (ti)
430 return this->copy_conversion (*ti);
431 return 0;
432}
const CopyConversionBase * copy_conversion(const std::type_info &tinfo) const
Search for a copy conversion to tinfo.
Definition BaseInfo.cxx:408

◆ copy_conversion() [2/2]

const CopyConversionBase * SG::BaseInfoBase::copy_conversion ( const std::type_info & tinfo) const

Search for a copy conversion to tinfo.

Parameters
tinfoThe class to which we want to convert.

Returns the conversion instance or 0.

Definition at line 408 of file BaseInfo.cxx.

409{
411 for (const auto& p : m_impl->m_ti_copyconversion_map) {
412 if (p.first == &tinfo)
413 return p.second;
414 }
415 return 0;
416}

◆ destroy()

void SG::BaseInfoBase::destroy ( void * p) const

Delete an instance of the described type.

Parameters
pPointer to the instance to delete (a T* cast to a void*).

Definition at line 439 of file BaseInfo.cxx.

440{
442 if (m_impl->m_destroy)
443 m_impl->m_destroy (p);
444}

◆ find() [1/2]

const BaseInfoBase * SG::BaseInfoBase::find ( CLID clid)
static

Find the BaseInfoBase instance for clid.

Parameters
clidThe class ID of the class for which we want information.

Returns 0 if no BaseInfoBase instance is available.

Definition at line 587 of file BaseInfo.cxx.

588{
589 const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
590 if (ti)
591 return BaseInfoBase::find (*ti);
592 return 0;
593}
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition BaseInfo.cxx:587

◆ find() [2/2]

const BaseInfoBase * SG::BaseInfoBase::find ( const std::type_info & tinfo)
static

Find the BaseInfoBase instance for tinfo.

Parameters
tinfoThe std::type_info of the class for which we want information.

Returns 0 if no BaseInfoBase instance is available.

Definition at line 650 of file BaseInfo.cxx.

651{
652 BaseInfoBase* bib = find1 (tinfo);
653
654 // If we didn't find it, try looking up by name.
655 // This to deal with the issue of sometimes getting duplicate
656 // @c std::type_info instances.
657 if (!bib) {
658 const std::type_info* tinfo2 = nullptr;
659 {
660 BaseInfoBaseImpl::lock_t lock (BaseInfoBaseImpl::s_mutex);
661 if (BaseInfoBaseImpl::s_ti_by_name) {
662 BaseInfoBaseImpl::ti_by_name_map_type::iterator i =
663 BaseInfoBaseImpl::s_ti_by_name->find (tinfo.name());
664 if (i != BaseInfoBaseImpl::s_ti_by_name->end() && i->second != &tinfo) {
665 tinfo2 = i->second;
666 }
667 }
668 }
669 if (tinfo2) {
670 bib = find1 (*tinfo2);
671 }
672 }
673
674 if (bib) {
675 BaseInfoBaseImpl& impl = *bib->m_impl;
676 BaseInfoBaseImpl::lock_t lock (impl.m_mutex);
677 if (impl.m_clid == CLID_NULL)
678 impl.m_clid = CLIDRegistry::typeinfoToCLID (*impl.m_typeinfo);
679 }
680
681 return bib;
682}
static BaseInfoBase * find1(const std::type_info &tinfo)
Helper for find.
Definition BaseInfo.cxx:603
BaseInfoBase(const std::type_info &tinfo, destroy_fn *destroy)
Constructor.
Definition BaseInfo.cxx:544

◆ find1()

BaseInfoBase * SG::BaseInfoBase::find1 ( const std::type_info & tinfo)
staticprivate

Helper for find.

Parameters
tinfoThe std::type_info of the class for which we want information.

Returns 0 if no BaseInfoBase instance is available.

Definition at line 603 of file BaseInfo.cxx.

604{
605 BaseInfoBase* bib = nullptr;
606 {
607 BaseInfoBaseImpl::lock_t lock (BaseInfoBaseImpl::s_mutex);
608 if (!BaseInfoBaseImpl::s_bi_by_ti) return 0;
609 BaseInfoBaseImpl::bi_by_ti_map_type::iterator i =
610 BaseInfoBaseImpl::s_bi_by_ti->find (&tinfo);
611 if (i != BaseInfoBaseImpl::s_bi_by_ti->end()) {
612 bib = i->second;
613 BaseInfoBaseImpl::lock_t lock (bib->m_impl->m_mutex);
614 if (!bib->m_impl->m_needs_init)
615 return bib;
616 bib->m_impl->m_needs_init = false;
617 }
618 }
619
620 // Try the initlist.
621 while (true) {
623 {
624 BaseInfoBaseImpl::lock_t lock (BaseInfoBaseImpl::s_mutex);
625 if (!BaseInfoBaseImpl::s_init_list) break;
626 BaseInfoBaseImpl::bi_by_ti_map_type::iterator i =
627 BaseInfoBaseImpl::s_bi_by_ti->find (&tinfo);
628 if (i != BaseInfoBaseImpl::s_bi_by_ti->end())
629 bib = i->second;
630 BaseInfoBaseImpl::init_list_t::iterator it =
631 BaseInfoBaseImpl::s_init_list->find (&tinfo);
632 if (it == BaseInfoBaseImpl::s_init_list->end()) break;
633 init = it->second;
634 BaseInfoBaseImpl::s_init_list->erase (it);
635 }
636 init (bib);
637 }
638
639 return bib;
640}
void init_func_t(BaseInfoBase *bib)
Type for an initialization function.
bool init(S_t &s, const float xlo, const float xhi, const unsigned int nbins)
Initialize a map to be used as a histogram.

◆ get_bases()

const std::vector< CLID > & SG::BaseInfoBase::get_bases ( ) const

Return the class IDs of all known bases of T (that have class IDs).

The list will include T itself.

Definition at line 307 of file BaseInfo.cxx.

308{
309 if (!m_impl->m_bases.isValid()) {
311 const BaseInfoBaseImpl::ti_map_type& map = m_impl->m_timap;
312 std::vector<CLID> v;
313 v.reserve (map.size());
314 for (const auto& p : map) {
316 if (clid != CLID_NULL)
317 v.push_back (clid);
318 }
319 m_impl->m_bases.set (std::move (v));
320 }
321 return *m_impl->m_bases.ptr();
322}
uint32_t CLID
The Class ID type.
std::vector< ti_map_pair_type > ti_map_type
Definition BaseInfo.cxx:66

◆ get_copy_conversions()

std::vector< CLID > SG::BaseInfoBase::get_copy_conversions ( ) const

Return known copy conversions.

Returns the CLIDs of all target classes that have been registered with this one for copy conversion.

Definition at line 470 of file BaseInfo.cxx.

471{
473 std::vector<CLID> out;
474 out.reserve (m_impl->m_ti_copyconversion_map.size());
475 for (const auto& i : m_impl->m_ti_copyconversion_map) {
477 if (clid != CLID_NULL)
478 out.push_back (clid);
479 }
480 return out;
481}

◆ get_ti_bases()

std::vector< const std::type_info * > SG::BaseInfoBase::get_ti_bases ( ) const

Return the type_info's of all known bases of T.

The list will include T itself.

Definition at line 329 of file BaseInfo.cxx.

330{
332 const BaseInfoBaseImpl::ti_map_type& map = m_impl->m_timap;
333 std::vector<const std::type_info*> v;
334 v.reserve (map.size());
335 for (const auto& i : map)
336 v.push_back (i.first);
337 return v;
338}

◆ is_base() [1/2]

bool SG::BaseInfoBase::is_base ( CLID clid) const

Return true if clid is the ID of a class that is known to be a base of T.

T is considered to be its own base for this purpose.

Parameters
clidThe ID of the class to test.

Definition at line 347 of file BaseInfo.cxx.

348{
349 const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
350 if (ti)
351 return this->is_base (*ti);
352 return 0;
353}
bool is_base(CLID clid) const
Return true if clid is the ID of a class that is known to be a base of T.
Definition BaseInfo.cxx:347

◆ is_base() [2/2]

bool SG::BaseInfoBase::is_base ( const std::type_info & tinfo) const

Return true if tinfo is the type_info of a class that is known to be a base of T.

T is considered to be its own base for this purpose.

Parameters
clidThe ID of the class to test.

Definition at line 362 of file BaseInfo.cxx.

363{
365 const BaseInfoBaseImpl::info* i = m_impl->findInfo (tinfo);
366 return i != 0;
367}

◆ is_virtual() [1/2]

bool SG::BaseInfoBase::is_virtual ( CLID clid) const

Return true if clid is the ID of a class that is known to be a virtual base of T.

(This will always be false for T itself.)

Parameters
clidThe ID of the class to test.

Definition at line 376 of file BaseInfo.cxx.

377{
378 const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
379 if (ti)
380 return this->is_virtual (*ti);
381 return false;
382}

◆ is_virtual() [2/2]

bool SG::BaseInfoBase::is_virtual ( const std::type_info & tinfo) const

Return true if tinfo is the std::type_info of a class that is known to be a virtual base of T.

(This will always be false for T itself.)

Parameters
tinfoThe std::type_info of the class to test.

Definition at line 391 of file BaseInfo.cxx.

392{
394 const BaseInfoBaseImpl::info* i = m_impl->findInfo (tinfo);
395 if (i)
396 return i->m_is_virtual;
397 return false;
398}

◆ maybeInit()

void SG::BaseInfoBase::maybeInit ( )

Run initializations for this class, if needed.

Definition at line 715 of file BaseInfo.cxx.

716{
717 // This may be null during initialization, if we're initializing a
718 // BaseInfo<T>::s_instance instance which references another type
719 // for which the s_instance constructor has not yet been run.
720 if (!m_impl) return;
721
722 bool needs_init = false;
723 const std::type_info* ti = nullptr;
724 {
726 needs_init = m_impl->m_needs_init;
727 ti = m_impl->m_typeinfo;
728 }
729
730 if (needs_init)
731 find (*ti);
732}

◆ operator=()

BaseInfoBase & SG::BaseInfoBase::operator= ( const BaseInfoBase & )
private

◆ typeinfo()

const std::type_info & SG::BaseInfoBase::typeinfo ( ) const

Return the std::type_info for this class.

Definition at line 154 of file BaseInfo.cxx.

155{
157 return *m_impl->m_typeinfo;
158}

◆ RegisterAddBaseInit

template<class D, class B>
friend struct RegisterAddBaseInit
friend

◆ RegisterAddCopyConversionInit

template<class D, class B>
friend struct RegisterAddCopyConversionInit
friend

Member Data Documentation

◆ m_impl

BaseInfoBaseImpl* SG::BaseInfoBase::m_impl
private

Pointer to internal state.

Definition at line 748 of file Control/AthenaKernel/AthenaKernel/BaseInfo.h.


The documentation for this class was generated from the following files: