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 543 of file BaseInfo.cxx.

545 : m_impl (new BaseInfoBaseImpl)
546{
547 m_impl->m_clid = CLIDRegistry::typeinfoToCLID (tinfo);
548 m_impl->m_typeinfo = &tinfo;
549 m_impl->m_destroy = destroy;
550 m_impl->m_needs_init = true;
551
552 BaseInfoBaseImpl::lock_t lock (BaseInfoBaseImpl::s_mutex);
553 if (!BaseInfoBaseImpl::s_bi_by_ti)
554 BaseInfoBaseImpl::s_bi_by_ti = new BaseInfoBaseImpl::bi_by_ti_map_type;
555 if (!BaseInfoBaseImpl::s_ti_by_name)
556 BaseInfoBaseImpl::s_ti_by_name = new BaseInfoBaseImpl::ti_by_name_map_type;
557
558 // Register this instance in the static maps.
559 (*BaseInfoBaseImpl::s_bi_by_ti)[&tinfo] = this;
560 (*BaseInfoBaseImpl::s_ti_by_name)[tinfo.name()] = &tinfo;
561}
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:438
BaseInfoBaseImpl * m_impl
Pointer to internal state.
virtual void lock() override
Lock the container.
std::lock_guard< mutex_t > lock_t
Definition BaseInfo.cxx:103
std::unordered_map< std::string, const std::type_info * > ti_by_name_map_type
Used to canonicalize type_info instances.
Definition BaseInfo.cxx:82
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:77

◆ ~BaseInfoBase()

SG::BaseInfoBase::~BaseInfoBase ( )
protected

Destructor.

Definition at line 567 of file BaseInfo.cxx.

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

◆ 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 454 of file BaseInfo.cxx.

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

◆ 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 493 of file BaseInfo.cxx.

497{
498 BaseInfoBaseImpl::lock_t slock (BaseInfoBaseImpl::s_mutex);
500 {
501 const BaseInfoBaseImpl::info* i = m_impl->findInfo (tinfo);
502 if (!i) {
503 m_impl->m_timap.emplace_back (&tinfo,
504 BaseInfoBaseImpl::info (converter, converterTo, is_virtual));
505 }
506 }
507
508 auto i = BaseInfoBaseImpl::s_bi_by_ti->find (&tinfo);
509 if (i != BaseInfoBaseImpl::s_bi_by_ti->end()) {
510 BaseInfoBaseImpl& impl = *i->second->m_impl;
511 if (impl.m_clid == CLID_NULL)
512 impl.m_clid = CLIDRegistry::typeinfoToCLID (tinfo);
513 }
514}
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:375

◆ 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 689 of file BaseInfo.cxx.

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

◆ 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 168 of file BaseInfo.cxx.

169{
170 const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
171 if (ti)
172 return this->cast (p, *ti);
173 return 0;
174}
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:143
void * cast(void *p, CLID clid) const
Cast to a base pointer.
Definition BaseInfo.cxx:168

◆ 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 185 of file BaseInfo.cxx.

186{
187 if (BaseInfoBase::castfn_t* converter = castfn (tinfo)) {
188 return converter (p);
189 }
190 return nullptr;
191}
castfn_t * castfn(CLID clid) const
Return a function for casting to a base pointer.
Definition BaseInfo.cxx:238
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 238 of file BaseInfo.cxx.

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

◆ 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 256 of file BaseInfo.cxx.

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

◆ 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 274 of file BaseInfo.cxx.

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

◆ 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 292 of file BaseInfo.cxx.

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

◆ 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 203 of file BaseInfo.cxx.

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

◆ 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 221 of file BaseInfo.cxx.

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

◆ clid()

CLID SG::BaseInfoBase::clid ( ) const

Return the CLID for this class.

Definition at line 143 of file BaseInfo.cxx.

144{
146 return m_impl->m_clid;
147}

◆ 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 425 of file BaseInfo.cxx.

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

◆ 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 407 of file BaseInfo.cxx.

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

◆ 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 438 of file BaseInfo.cxx.

439{
441 if (m_impl->m_destroy)
442 m_impl->m_destroy (p);
443}

◆ 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 586 of file BaseInfo.cxx.

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

◆ 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 649 of file BaseInfo.cxx.

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

◆ 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 602 of file BaseInfo.cxx.

603{
604 BaseInfoBase* bib = nullptr;
605 {
606 BaseInfoBaseImpl::lock_t lock (BaseInfoBaseImpl::s_mutex);
607 if (!BaseInfoBaseImpl::s_bi_by_ti) return 0;
608 BaseInfoBaseImpl::bi_by_ti_map_type::iterator i =
609 BaseInfoBaseImpl::s_bi_by_ti->find (&tinfo);
610 if (i != BaseInfoBaseImpl::s_bi_by_ti->end()) {
611 bib = i->second;
612 BaseInfoBaseImpl::lock_t lock (bib->m_impl->m_mutex);
613 if (!bib->m_impl->m_needs_init)
614 return bib;
615 bib->m_impl->m_needs_init = false;
616 }
617 }
618
619 // Try the initlist.
620 while (true) {
622 {
623 BaseInfoBaseImpl::lock_t lock (BaseInfoBaseImpl::s_mutex);
624 if (!BaseInfoBaseImpl::s_init_list) break;
625 BaseInfoBaseImpl::bi_by_ti_map_type::iterator i =
626 BaseInfoBaseImpl::s_bi_by_ti->find (&tinfo);
627 if (i != BaseInfoBaseImpl::s_bi_by_ti->end())
628 bib = i->second;
629 BaseInfoBaseImpl::init_list_t::iterator it =
630 BaseInfoBaseImpl::s_init_list->find (&tinfo);
631 if (it == BaseInfoBaseImpl::s_init_list->end()) break;
632 init = it->second;
633 BaseInfoBaseImpl::s_init_list->erase (it);
634 }
635 init (bib);
636 }
637
638 return bib;
639}
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 306 of file BaseInfo.cxx.

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

◆ 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 469 of file BaseInfo.cxx.

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

◆ 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 328 of file BaseInfo.cxx.

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

◆ 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 346 of file BaseInfo.cxx.

347{
348 const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
349 if (ti)
350 return this->is_base (*ti);
351 return 0;
352}
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:346

◆ 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 361 of file BaseInfo.cxx.

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

◆ 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 375 of file BaseInfo.cxx.

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

◆ 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 390 of file BaseInfo.cxx.

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

◆ maybeInit()

void SG::BaseInfoBase::maybeInit ( )

Run initializations for this class, if needed.

Definition at line 714 of file BaseInfo.cxx.

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

◆ 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 153 of file BaseInfo.cxx.

154{
156 return *m_impl->m_typeinfo;
157}

◆ 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: