@@ -170,9 +170,10 @@ class ApplicationContext::ComponentHolder {
170
170
171
171
// How many paths exist to access this component by type or name.
172
172
// Use to detect orphan component cause by type and name conflict.
173
- inline size_t accessable_path_number () const noexcept ;
173
+ inline size_t accessible_path_number () const noexcept ;
174
174
175
175
inline const ::std::string& name () const noexcept ;
176
+ inline const Id* type_id () const noexcept ;
176
177
177
178
protected:
178
179
// 构造时需要给定必要的类型信息
@@ -293,8 +294,8 @@ class ApplicationContext::ComponentHolder {
293
294
int >::type = 0 >
294
295
static int initialize (Any&, ApplicationContext&, const Any&) noexcept ;
295
296
296
- inline void increase_accessable_path () noexcept ;
297
- inline void decrease_accessable_path () noexcept ;
297
+ inline void increase_accessible_path () noexcept ;
298
+ inline void decrease_accessible_path () noexcept ;
298
299
299
300
inline void set_name (StringView name) noexcept ;
300
301
@@ -309,7 +310,7 @@ class ApplicationContext::ComponentHolder {
309
310
SingletonState _singleton_state {SingletonState::UNINITIALIZED};
310
311
Any _singleton;
311
312
size_t _sequence {0 };
312
- size_t _accessable_path {0 };
313
+ size_t _accessible_path {0 };
313
314
314
315
friend ApplicationContext;
315
316
};
@@ -588,15 +589,20 @@ ApplicationContext::ComponentHolder::sequence() const noexcept {
588
589
}
589
590
590
591
inline ABSL_ATTRIBUTE_ALWAYS_INLINE size_t
591
- ApplicationContext::ComponentHolder::accessable_path_number () const noexcept {
592
- return _accessable_path ;
592
+ ApplicationContext::ComponentHolder::accessible_path_number () const noexcept {
593
+ return _accessible_path ;
593
594
}
594
595
595
596
inline ABSL_ATTRIBUTE_ALWAYS_INLINE const ::std::string&
596
597
ApplicationContext::ComponentHolder::name () const noexcept {
597
598
return _name;
598
599
}
599
600
601
+ inline ABSL_ATTRIBUTE_ALWAYS_INLINE const Id*
602
+ ApplicationContext::ComponentHolder::type_id () const noexcept {
603
+ return &(_type_id->type_id );
604
+ }
605
+
600
606
template <typename T>
601
607
ABSL_ATTRIBUTE_NOINLINE void
602
608
ApplicationContext::ComponentHolder::set_type () noexcept {
@@ -711,13 +717,13 @@ ABSL_ATTRIBUTE_NOINLINE int ApplicationContext::ComponentHolder::initialize(
711
717
}
712
718
713
719
inline void
714
- ApplicationContext::ComponentHolder::increase_accessable_path () noexcept {
715
- _accessable_path ++;
720
+ ApplicationContext::ComponentHolder::increase_accessible_path () noexcept {
721
+ _accessible_path ++;
716
722
}
717
723
718
724
inline void
719
- ApplicationContext::ComponentHolder::decrease_accessable_path () noexcept {
720
- _accessable_path --;
725
+ ApplicationContext::ComponentHolder::decrease_accessible_path () noexcept {
726
+ _accessible_path --;
721
727
}
722
728
723
729
inline void ApplicationContext::ComponentHolder::set_name (
0 commit comments