File indexing completed on 2025-10-17 09:11:20
0001
0002
0003
0004
0005 #pragma once
0006
0007 #include <JANA/JObject.h>
0008 #include <JANA/JException.h>
0009 #include <JANA/JFactoryT.h>
0010 #include <JANA/JFactorySet.h>
0011 #include <JANA/JLogger.h>
0012 #include <JANA/JVersion.h>
0013
0014 #include <JANA/Components/JLightweightDatabundle.h>
0015 #if JANA2_HAVE_PODIO
0016 #include <JANA/Components/JPodioDatabundle.h>
0017 #endif
0018
0019 #include <JANA/Utils/JEventLevel.h>
0020 #include <JANA/Utils/JTypeInfo.h>
0021 #include <JANA/Utils/JCpuInfo.h>
0022 #include <JANA/Utils/JCallGraphRecorder.h>
0023 #include <JANA/Utils/JCallGraphEntryMaker.h>
0024 #include <JANA/Utils/JInspector.h>
0025
0026 #include <typeindex>
0027 #include <cstdint>
0028 #include <vector>
0029 #include <memory>
0030 #include <atomic>
0031
0032
0033 class JApplication;
0034 class JEventSource;
0035
0036
0037 class JEvent : public std::enable_shared_from_this<JEvent> {
0038
0039 private:
0040 JApplication* mApplication = nullptr;
0041 int32_t mRunNumber = 0;
0042 uint64_t mEventNumber = 0;
0043 mutable JFactorySet mFactorySet;
0044 mutable JCallGraphRecorder mCallGraph;
0045 mutable JInspector mInspector;
0046 mutable std::string mEventStamp;
0047 bool mUseDefaultTags = false;
0048 std::map<std::string, std::string> mDefaultTags;
0049 JEventSource* mEventSource = nullptr;
0050 bool mIsBarrierEvent = false;
0051 bool mIsWarmedUp = false;
0052
0053
0054 std::vector<std::pair<JEventLevel, std::pair<JEvent*, uint64_t>>> mParents;
0055 std::atomic_int mReferenceCount {0};
0056 int64_t mEventIndex = -1;
0057
0058 void MakeEventStamp() const;
0059
0060 public:
0061 JEvent();
0062 explicit JEvent(JApplication* app);
0063 virtual ~JEvent();
0064
0065 void SetRunNumber(int32_t aRunNumber){mRunNumber = aRunNumber; MakeEventStamp(); }
0066 void SetEventNumber(uint64_t aEventNumber){mEventNumber = aEventNumber; MakeEventStamp(); }
0067 void SetJApplication(JApplication* app){mApplication = app;}
0068 void SetJEventSource(JEventSource* aSource){mEventSource = aSource;}
0069 void SetDefaultTags(std::map<std::string, std::string> aDefaultTags){mDefaultTags=aDefaultTags; mUseDefaultTags = !mDefaultTags.empty();}
0070 void SetSequential(bool isSequential) {mIsBarrierEvent = isSequential;}
0071
0072 JFactorySet* GetFactorySet() const { return &mFactorySet; }
0073 int32_t GetRunNumber() const {return mRunNumber;}
0074 uint64_t GetEventNumber() const {return mEventNumber;}
0075 JApplication* GetJApplication() const {return mApplication;}
0076 JEventSource* GetJEventSource() const {return mEventSource; }
0077 JCallGraphRecorder* GetJCallGraphRecorder() const {return &mCallGraph;}
0078 JInspector* GetJInspector() const {return &mInspector;}
0079 void Inspect() const { mInspector.Loop();}
0080 bool GetSequential() const {return mIsBarrierEvent;}
0081 bool IsWarmedUp() { return mIsWarmedUp; }
0082
0083
0084 JEventLevel GetLevel() const { return mFactorySet.GetLevel(); }
0085 void SetLevel(JEventLevel level) { mFactorySet.SetLevel(level); }
0086 void SetEventIndex(int event_index) { mEventIndex = event_index; }
0087 int64_t GetEventIndex() const { return mEventIndex; }
0088 const std::string& GetEventStamp() const;
0089
0090 bool HasParent(JEventLevel level) const;
0091 const JEvent& GetParent(JEventLevel level) const;
0092 void SetParent(JEvent* parent);
0093 JEvent* ReleaseParent(JEventLevel level);
0094 std::vector<JEvent*> ReleaseAllParents();
0095 int GetChildCount();
0096 uint64_t GetParentNumber(JEventLevel level) const;
0097 void SetParentNumber(JEventLevel level, uint64_t number);
0098
0099 void TakeRefToSelf();
0100 int ReleaseRefToSelf();
0101
0102
0103 void Clear(bool processed_successfully=true);
0104 void Finish();
0105
0106 JFactory* GetFactory(const std::string& object_name, const std::string& tag) const;
0107 std::vector<JFactory*> GetAllFactories() const;
0108
0109
0110 template<class T> JFactoryT<T>* GetFactory(const std::string& tag = "", bool throw_on_missing=false) const;
0111 template<class T> JLightweightDatabundleT<T>* GetLightweightDatabundle(const std::string& tag, bool throw_on_missing, bool call_factory_create) const;
0112 template<class T> std::vector<JFactoryT<T>*> GetFactoryAll(bool throw_on_missing = false) const;
0113
0114
0115 template<class T> JFactoryT<T>* GetSingle(const T* &t, const char *tag="", bool exception_if_not_one=true) const;
0116 template<class T> JFactoryT<T>* Get(const T** item, const std::string& tag="") const;
0117 template<class T> JFactoryT<T>* Get(std::vector<const T*> &vec, const std::string& tag = "", bool strict=true) const;
0118 template<class T> void GetAll(std::vector<const T*> &vec) const;
0119
0120
0121 template<class T> const T* GetSingle(const std::string& tag = "") const;
0122 template<class T> const T* GetSingleStrict(const std::string& tag = "") const;
0123 template<class T> std::vector<const T*> Get(const std::string& tag = "", bool strict=true) const;
0124 template<class T> typename JFactoryT<T>::PairType GetIterators(const std::string& aTag = "") const;
0125 template<class T> std::vector<const T*> GetAll() const;
0126 template<class T> std::map<std::pair<std::string,std::string>,std::vector<T*>> GetAllChildren() const;
0127
0128
0129 template <class T> JFactoryT<T>* Insert(T* item, const std::string& aTag = "") const;
0130 template <class T> JFactoryT<T>* Insert(const std::vector<T*>& items, const std::string& tag = "") const;
0131
0132
0133 #if JANA2_HAVE_PODIO
0134 std::vector<std::string> GetAllCollectionNames() const;
0135 const podio::CollectionBase* GetCollectionBase(std::string name, bool throw_on_missing=true) const;
0136 template <typename T> const typename T::collection_type* GetCollection(std::string name, bool throw_on_missing=true) const;
0137 template <typename T> void InsertCollection(typename T::collection_type&& collection, std::string name);
0138 template <typename T> void InsertCollectionAlreadyInFrame(const podio::CollectionBase* collection, std::string name);
0139 #endif
0140
0141
0142 };
0143
0144
0145
0146
0147 template<class T>
0148 inline JFactoryT<T>* JEvent::GetFactory(const std::string& tag, bool throw_on_missing) const
0149 {
0150 std::string resolved_tag = tag;
0151 if (mUseDefaultTags && tag.empty()) {
0152 auto defaultTag = mDefaultTags.find(JTypeInfo::demangle<T>());
0153 if (defaultTag != mDefaultTags.end()) resolved_tag = defaultTag->second;
0154 }
0155 auto* databundle = mFactorySet.GetDatabundle(std::type_index(typeid(T)), resolved_tag);
0156 if (databundle == nullptr) {
0157 if (throw_on_missing) {
0158 JException ex("Could not find databundle with type_index=" + JTypeInfo::demangle<T>() + " and tag=" + tag);
0159 ex.show_stacktrace = false;
0160 mFactorySet.Print();
0161 throw ex;
0162 }
0163 return nullptr;
0164 };
0165 auto* factory = databundle->GetFactory();
0166 if (factory == nullptr) {
0167 if (throw_on_missing) {
0168 JException ex("No factory provided for databundle with type_index=" + JTypeInfo::demangle<T>() + " and tag=" + tag);
0169 ex.show_stacktrace = false;
0170 mFactorySet.Print();
0171 throw ex;
0172 }
0173 return nullptr;
0174 };
0175 auto* typed_factory = dynamic_cast<JFactoryT<T>*>(databundle->GetFactory());
0176 if (typed_factory == nullptr) {
0177 if (throw_on_missing) {
0178 JException ex("Factory does not inherit from JFactoryT<T> for databundle with type_index=" + JTypeInfo::demangle<T>() + " and tag=" + tag);
0179 ex.show_stacktrace = false;
0180 mFactorySet.Print();
0181 throw ex;
0182 }
0183 return nullptr;
0184 };
0185 return typed_factory;
0186 }
0187
0188 template<class T>
0189 JLightweightDatabundleT<T>* JEvent::GetLightweightDatabundle(const std::string& tag, bool throw_on_missing, bool call_factory_create) const {
0190 std::string resolved_tag = tag;
0191 if (mUseDefaultTags && tag.empty()) {
0192 auto defaultTag = mDefaultTags.find(JTypeInfo::demangle<T>());
0193 if (defaultTag != mDefaultTags.end()) resolved_tag = defaultTag->second;
0194 }
0195 auto* databundle = mFactorySet.GetDatabundle(std::type_index(typeid(T)), resolved_tag);
0196 if (databundle == nullptr) {
0197 if (throw_on_missing) {
0198 JException ex("Could not find databundle with type_index=" + JTypeInfo::demangle<T>() + " and tag=" + tag);
0199 ex.show_stacktrace = false;
0200 mFactorySet.Print();
0201 throw ex;
0202 }
0203 return nullptr;
0204 };
0205 auto* typed_databundle = dynamic_cast<JLightweightDatabundleT<T>*>(databundle);
0206 if (typed_databundle == nullptr) {
0207 if (throw_on_missing) {
0208 JException ex("Databundle with shortname '%s' does not inherit from JLightweightDatabundleT<%s>", tag.c_str(), JTypeInfo::demangle<T>().c_str());
0209 ex.show_stacktrace = false;
0210 mFactorySet.Print();
0211 throw ex;
0212 }
0213 return nullptr;
0214 }
0215 auto factory = databundle->GetFactory();
0216 if (call_factory_create && factory != nullptr) {
0217
0218 JCallGraphEntryMaker cg_entry(mCallGraph, factory);
0219 factory->Create(*this);
0220 }
0221 return typed_databundle;
0222 }
0223
0224
0225
0226
0227
0228 template<class T>
0229 inline std::vector<JFactoryT<T>*> JEvent::GetFactoryAll(bool throw_on_missing) const {
0230 std::vector<JFactoryT<T>*> factories;
0231 for (auto* factory : mFactorySet.GetAllFactories()) {
0232 auto typed_factory = dynamic_cast<JFactoryT<T>*>(factory);
0233 if (typed_factory != nullptr) {
0234 factories.push_back(typed_factory);
0235 }
0236 }
0237 if (factories.size() == 0) {
0238 if (throw_on_missing) {
0239 JException ex("Could not find any JFactoryT<" + JTypeInfo::demangle<T>() + "> (from any tag)");
0240 throw ex;
0241 }
0242 };
0243 return factories;
0244 }
0245
0246
0247
0248
0249 template<class T>
0250 JFactoryT<T>* JEvent::GetSingle(const T* &t, const char *tag, bool exception_if_not_one) const {
0251
0252
0253
0254
0255
0256
0257
0258
0259
0260
0261
0262
0263 auto* databundle = GetLightweightDatabundle<T>(tag, true, true);
0264 if (databundle->GetSize() != 1) {
0265 t = nullptr;
0266 if (exception_if_not_one) {
0267 throw JException("GetSingle<%s>: Databundle has wrong number of items: 1 expected, %d found.", JTypeInfo::demangle<T>().c_str(), databundle->GetSize());
0268 }
0269 }
0270 else {
0271 t = databundle->GetData().at(0);
0272 }
0273 return dynamic_cast<JFactoryT<T>*>(databundle->GetFactory());
0274 }
0275
0276
0277
0278
0279
0280
0281
0282
0283 template<class T>
0284 JFactoryT<T>* JEvent::Get(const T** destination, const std::string& tag) const {
0285 auto* databundle = GetLightweightDatabundle<T>(tag, true, true);
0286 if (databundle->GetSize() == 0) {
0287 *destination = nullptr;
0288 }
0289 else {
0290 *destination = databundle->GetData().at(0);
0291 }
0292 return dynamic_cast<JFactoryT<T>*>(databundle->GetFactory());
0293 }
0294
0295
0296 template<class T>
0297 JFactoryT<T>* JEvent::Get(std::vector<const T*>& destination, const std::string& tag, bool strict) const
0298 {
0299 auto* databundle = GetLightweightDatabundle<T>(tag, strict, true);
0300 if (databundle != nullptr) {
0301 for (auto* item : databundle->GetData()) {
0302 destination.push_back(item);
0303 }
0304 }
0305 return dynamic_cast<JFactoryT<T>*>(databundle->GetFactory());
0306 }
0307
0308
0309
0310 template<class T>
0311 void JEvent::GetAll(std::vector<const T*>& destination) const {
0312 auto factories = GetFactoryAll<T>(true);
0313 for (auto factory : factories) {
0314 auto iterators = factory->CreateAndGetData(*this);
0315 for (auto it = iterators.first; it != iterators.second; it++) {
0316 destination.push_back(*it);
0317 }
0318 }
0319 }
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332 template<class T> const T* JEvent::GetSingle(const std::string& tag) const {
0333
0334 auto databundle = GetLightweightDatabundle<T>(tag, true, true);
0335 if (databundle->GetSize() == 0) {
0336 return nullptr;
0337 }
0338 return databundle->GetData().at(0);
0339 }
0340
0341
0342
0343
0344
0345
0346
0347
0348
0349 template<class T> const T* JEvent::GetSingleStrict(const std::string& tag) const {
0350
0351 auto databundle = GetLightweightDatabundle<T>(tag, true, true);
0352 if (databundle->GetSize() == 0) {
0353 JException ex("GetSingle failed due to missing %d", NAME_OF(T));
0354 ex.show_stacktrace = false;
0355 throw ex;
0356 return nullptr;
0357 }
0358 else if (databundle->GetSize() > 1) {
0359 JException ex("GetSingle failed due to too many %d", NAME_OF(T));
0360 ex.show_stacktrace = false;
0361 throw ex;
0362 }
0363 return databundle->GetData().at(0);
0364 }
0365
0366 template<class T>
0367 std::vector<const T*> JEvent::Get(const std::string& tag, bool strict) const {
0368
0369 auto databundle = GetLightweightDatabundle<T>(tag, strict, true);
0370 std::vector<const T*> vec;
0371 if (databundle != nullptr) {
0372 for (auto x: databundle->GetData()) {
0373 vec.push_back(x);
0374 }
0375 }
0376 return vec;
0377 }
0378
0379 template<class T>
0380 typename JFactoryT<T>::PairType JEvent::GetIterators(const std::string& tag) const {
0381
0382 auto databundle = GetLightweightDatabundle<T>(tag, true, true);
0383 auto& data = databundle->GetData();
0384 return std::make_pair(data.cbegin(), data.cend());
0385 }
0386
0387
0388 template<class T>
0389 std::vector<const T*> JEvent::GetAll() const {
0390
0391 std::vector<const T*> results;
0392
0393 for (auto databundle : mFactorySet.GetDatabundles(std::type_index(typeid(T)))) {
0394 auto fac = databundle->GetFactory();
0395 if (fac != nullptr) {
0396 fac->Create(*this);
0397 }
0398 auto typed_databundle = dynamic_cast<JLightweightDatabundleT<T>*>(databundle);
0399 if (typed_databundle != nullptr) {
0400 for (auto* item : typed_databundle->GetData()) {
0401 results.push_back(item);
0402 }
0403 }
0404 }
0405 return results;
0406 }
0407
0408
0409
0410
0411
0412
0413 template<class S>
0414 std::map<std::pair<std::string, std::string>, std::vector<S*>> JEvent::GetAllChildren() const {
0415 std::map<std::pair<std::string, std::string>, std::vector<S*>> results;
0416 for (JDatabundle* databundle: mFactorySet.GetAllDatabundles()) {
0417 auto val = databundle->GetAs<S>();
0418 if (!val.empty()) {
0419 auto key = std::make_pair(databundle->GetTypeName(),
0420 databundle->HasShortName() ? databundle->GetShortName() : databundle->GetUniqueName());
0421 results.insert(std::make_pair(key, val));
0422 }
0423 }
0424 return results;
0425 }
0426
0427
0428
0429
0430
0431
0432
0433 template <class T>
0434 inline JFactoryT<T>* JEvent::Insert(T* item, const std::string& tag) const {
0435
0436 auto* databundle = GetLightweightDatabundle<T>(tag, false, false);
0437
0438 if (databundle == nullptr) {
0439 auto* factory = new JFactoryT<T>;
0440 factory->SetTag(tag);
0441 factory->SetLevel(mFactorySet.GetLevel());
0442 mFactorySet.Add(factory);
0443 databundle = GetLightweightDatabundle<T>(tag, false, false);
0444 }
0445
0446 databundle->SetStatus(JDatabundle::Status::Inserted);
0447 databundle->GetData().push_back(item);
0448
0449 auto* factory = databundle->GetFactory();
0450 if (factory != nullptr) {
0451 factory->SetStatus(JFactory::Status::Inserted);
0452 factory->SetCreationStatus(JFactory::CreationStatus::Inserted);
0453 factory->SetInsertOrigin( mCallGraph.GetInsertDataOrigin() );
0454 return dynamic_cast<JFactoryT<T>*>(factory);
0455 }
0456 throw JException("Attempted to call JEvent::Insert without an underlying JFactoryT. Hint: Did you previously use Output<T>?");
0457
0458 }
0459
0460 template <class T>
0461 inline JFactoryT<T>* JEvent::Insert(const std::vector<T*>& items, const std::string& tag) const {
0462
0463 auto* databundle = GetLightweightDatabundle<T>(tag, false, false);
0464
0465 if (databundle == nullptr) {
0466 auto* factory = new JFactoryT<T>;
0467 factory->SetTag(tag);
0468 factory->SetLevel(mFactorySet.GetLevel());
0469 mFactorySet.Add(factory);
0470 databundle = GetLightweightDatabundle<T>(tag, false, false);
0471 }
0472
0473 databundle->SetStatus(JDatabundle::Status::Inserted);
0474 databundle->GetData() = items;
0475
0476 auto* factory = databundle->GetFactory();
0477 if (factory != nullptr) {
0478 factory->SetStatus(JFactory::Status::Inserted);
0479 factory->SetCreationStatus(JFactory::CreationStatus::Inserted);
0480 factory->SetInsertOrigin( mCallGraph.GetInsertDataOrigin() );
0481 return dynamic_cast<JFactoryT<T>*>(factory);
0482 }
0483 throw JException("Attempted to call JEvent::Insert without an underlying JFactoryT. Hint: Did you previously use Output<T>?");
0484
0485 }
0486
0487
0488
0489 #if JANA2_HAVE_PODIO
0490
0491 inline std::vector<std::string> JEvent::GetAllCollectionNames() const {
0492 std::vector<std::string> unique_names;
0493 for (auto databundle : mFactorySet.GetAllDatabundles()) {
0494 if (dynamic_cast<JPodioDatabundle*>(databundle) != nullptr) {
0495 unique_names.push_back(databundle->GetUniqueName());
0496 }
0497 }
0498 return unique_names;
0499 }
0500
0501 inline const podio::CollectionBase* JEvent::GetCollectionBase(std::string unique_name, bool throw_on_missing) const {
0502 auto* bundle = mFactorySet.GetDatabundle(unique_name);
0503 if (bundle == nullptr) {
0504 if (throw_on_missing) {
0505 throw JException("Missing databundle with uniquename '%s'", unique_name.c_str());
0506 }
0507 return nullptr;
0508 }
0509
0510 auto* typed_bundle = dynamic_cast<JPodioDatabundle*>(bundle);
0511 if (typed_bundle == nullptr) {
0512 if (throw_on_missing) {
0513 throw JException("Databundle with uniquename '%s' is not a JPodioDatabundle", unique_name.c_str());
0514 }
0515 return nullptr;
0516 }
0517
0518 if (typed_bundle->GetStatus() == JDatabundle::Status::Empty) {
0519 auto* fac = typed_bundle->GetFactory();
0520 if (fac != nullptr) {
0521 JCallGraphEntryMaker cg_entry(mCallGraph, fac);
0522 fac->Create(*this);
0523 }
0524 }
0525
0526 return typed_bundle->GetCollection();
0527 }
0528
0529
0530 template <typename T>
0531 const typename T::collection_type* JEvent::GetCollection(std::string name, bool throw_on_missing) const {
0532
0533 auto collection = GetCollectionBase(name, throw_on_missing);
0534 auto* typed_collection = dynamic_cast<const typename T::collection_type*>(collection);
0535 if (throw_on_missing && typed_collection == nullptr) {
0536 throw JException("Databundle with uniquename '%s' does not contain %s", JTypeInfo::demangle<typename T::collection_type>().c_str());
0537 }
0538 return typed_collection;
0539 }
0540
0541
0542 template <typename T>
0543 void JEvent::InsertCollection(typename T::collection_type&& collection, std::string name) {
0544
0545
0546 if (name.empty()) {
0547 throw JException("JEvent::InsertCollection: Podio collection names must be non-empty!");
0548 }
0549
0550 podio::Frame* frame = nullptr;
0551 auto* bundle = mFactorySet.GetDatabundle("podio::Frame");
0552
0553 if (bundle == nullptr) {
0554
0555 frame = new podio::Frame();
0556 Insert(frame, "");
0557
0558
0559
0560 }
0561 else {
0562 JLightweightDatabundleT<podio::Frame>* typed_bundle = nullptr;
0563 typed_bundle = dynamic_cast<JLightweightDatabundleT<podio::Frame>*>(bundle);
0564 if (typed_bundle == nullptr) {
0565 throw JException("Databundle with unique_name 'podio::Frame' is not a JLightweightDatabundleT");
0566 }
0567 if (typed_bundle->GetSize() == 0) {
0568
0569 typed_bundle->GetData().push_back(new podio::Frame);
0570 typed_bundle->SetStatus(JDatabundle::Status::Inserted);
0571 }
0572 frame = typed_bundle->GetData().at(0);
0573 }
0574
0575 const auto& owned_collection = frame->put(std::move(collection), name);
0576 InsertCollectionAlreadyInFrame<T>(&owned_collection, name);
0577 }
0578
0579
0580 template <typename T>
0581 void JEvent::InsertCollectionAlreadyInFrame(const podio::CollectionBase* collection, std::string unique_name) {
0582
0583
0584
0585
0586 const auto* typed_collection = dynamic_cast<const typename T::collection_type*>(collection);
0587 if (typed_collection == nullptr) {
0588 mFactorySet.Print();
0589 throw JException("Attempted to insert a collection of the wrong type! name='%s', expected type='%s', actual type='%s'",
0590 unique_name.c_str(), JTypeInfo::demangle<typename T::collection_type>().c_str(), collection->getDataTypeName().data());
0591 }
0592
0593
0594 if (mUseDefaultTags && unique_name.empty()) {
0595 auto defaultTag = mDefaultTags.find(JTypeInfo::demangle<T>());
0596 if (defaultTag != mDefaultTags.end()) unique_name = defaultTag->second;
0597 }
0598
0599
0600
0601 JDatabundle* bundle = mFactorySet.GetDatabundle(unique_name);
0602 JPodioDatabundle* typed_bundle = nullptr;
0603
0604 if (bundle == nullptr) {
0605 typed_bundle = new JPodioDatabundle();
0606 typed_bundle->SetUniqueName(unique_name);
0607 typed_bundle->SetTypeIndex(std::type_index(typeid(T)));
0608 typed_bundle->SetTypeName(JTypeInfo::demangle<T>());
0609 mFactorySet.Add(typed_bundle);
0610
0611 }
0612 else {
0613 typed_bundle = dynamic_cast<JPodioDatabundle*>(bundle);
0614 if (typed_bundle == nullptr) {
0615 mFactorySet.Print();
0616 throw JException("Databundle with unique_name='%s' must be a JPodioDatabundle in order to insert a Podio collection", unique_name.c_str());
0617 }
0618 if (typed_bundle->GetStatus() != JDatabundle::Status::Empty) {
0619
0620 mFactorySet.Print();
0621 throw JException("A Podio collection with unique_name='%s' is already present and cannot be overwritten", unique_name.c_str());
0622 }
0623 }
0624
0625 typed_bundle->SetStatus(JDatabundle::Status::Inserted);
0626 typed_bundle->SetCollection(typed_collection);
0627 auto fac = typed_bundle->GetFactory();
0628 if (fac) {
0629 fac->SetStatus(JFactory::Status::Inserted);
0630 }
0631 }
0632
0633 #endif
0634
0635
0636