[odb-users] How to cache the queried object pointer?

Boris Kolpackov boris at codesynthesis.com
Tue Nov 5 09:38:12 EST 2019


Justin Huang <yohuang at nvidia.com> writes:

> public:
>     #pragma db transient
>     static std::map<std::string, Module*> modules_;
>     static size_t count;
>
> private:
>     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 mailing list