[odb-users] How to cache the queried object pointer?
boris at codesynthesis.com
Tue Nov 5 09:38:12 EST 2019
Justin Huang <yohuang at nvidia.com> writes:
> #pragma db transient
> static std::map<std::string, Module*> modules_;
> static size_t count;
> std::vector<Port*> ports_;
> std::vector<Instance*> instances_;
> std::vector<Connection*> connections_;
You don't need to mark static data members as transient. And I think
what happens here is that db transient pragma applies to the first
non-static data member, which is ports_.
More information about the odb-users