@@ -28,7 +28,6 @@ ComponentInfo::ComponentInfo(ComponentId_t id, const std::string& name) :
2828 link_map (nullptr ),
2929 component (nullptr ),
3030 params (nullptr ),
31- defaultTimeBase (nullptr ),
3231 portModules (nullptr ),
3332 stat_configs_ (nullptr ),
3433 enabled_stat_names_ (nullptr ),
@@ -50,7 +49,6 @@ ComponentInfo::ComponentInfo() :
5049 link_map (nullptr ),
5150 component (nullptr ),
5251 params (nullptr ),
53- defaultTimeBase (nullptr ),
5452 portModules (nullptr ),
5553 stat_configs_ (nullptr ),
5654 enabled_stat_names_ (nullptr ),
@@ -92,7 +90,6 @@ ComponentInfo::ComponentInfo(
9290 link_map (nullptr ),
9391 component (nullptr ),
9492 params (/* new Params()*/ nullptr ),
95- defaultTimeBase (nullptr ),
9693 portModules (nullptr ),
9794 stat_configs_ (nullptr ),
9895 enabled_stat_names_ (nullptr ),
@@ -116,8 +113,7 @@ ComponentInfo::ComponentInfo(
116113 type (ccomp->type),
117114 link_map (link_map),
118115 component (nullptr ),
119- params (&ccomp->params), // Inaccessible after construction
120- defaultTimeBase (nullptr ),
116+ params (&ccomp->params), // Inaccessible after construction
121117 portModules (&ccomp->portModules), // Inaccessible after construction
122118 enabled_all_stats_ (ccomp->enabledAllStats),
123119 statLoadLevel (ccomp->statLoadLevel),
@@ -178,10 +174,10 @@ ComponentInfo::ComponentInfo(ComponentInfo&& o) :
178174 slot_num (o.slot_num),
179175 share_flags (o.share_flags)
180176{
181- o.parent_info = nullptr ;
182- o.link_map = nullptr ;
183- o.component = nullptr ;
184- o.defaultTimeBase = nullptr ;
177+ o.parent_info = nullptr ;
178+ o.link_map = nullptr ;
179+ o.component = nullptr ;
180+ o.defaultTimeBase . reset () ;
185181}
186182
187183ComponentInfo::~ComponentInfo ()
@@ -390,7 +386,7 @@ ComponentInfo::hasLinks() const
390386// // Functions for testing serialization
391387
392388ComponentInfo::ComponentInfo (
393- ComponentId_t id, const std::string& name, const std::string& slot_name, TimeConverter* tv) :
389+ ComponentId_t id, const std::string& name, const std::string& slot_name, TimeConverter tv) :
394390 id_ (id),
395391 parent_info (nullptr ),
396392 name (name),
@@ -411,7 +407,7 @@ ComponentInfo::ComponentInfo(
411407{}
412408
413409ComponentInfo*
414- ComponentInfo::test_addSubComponentInfo (const std::string& name, const std::string& slot_name, TimeConverter* tv)
410+ ComponentInfo::test_addSubComponentInfo (const std::string& name, const std::string& slot_name, TimeConverter tv)
415411{
416412 // Get next id, which is stored only in the ultimate parent
417413 ComponentInfo* real_comp = this ;
@@ -432,7 +428,7 @@ ComponentInfo::test_printComponentInfoHierarchy(int indent)
432428 for ( int i = 0 ; i < indent; ++i )
433429 printf (" " );
434430 printf (" id = %" PRIu64 " , name = %s, slot_name = %s" , id_, name.c_str (), slot_name.c_str ());
435- if ( defaultTimeBase != nullptr ) printf (" , defaultTimeBase = %" PRI_SIMTIME, defaultTimeBase-> getFactor ());
431+ if ( defaultTimeBase. isInitialized () ) printf (" , defaultTimeBase = %" PRI_SIMTIME, defaultTimeBase. getFactor ());
436432 if ( parent_info != nullptr ) printf (" , parent_id = %" PRIu64, parent_info->id_ );
437433 printf (" \n " );
438434
0 commit comments