ost::TypeManager(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– ost::TypeManager β€” bestie's guide to the persistence type registry πŸ’–

okay so you're in the ost namespace and you found the manual page for ost::TypeManager(3). Welcome, queen. This is part of the Library Functions Manual and honestly? She's the backstage manager of your whole persistent-object situation. Let's get into it πŸŽ€


🌸 NAME 🌸

ost::TypeManager β€” literally the class that manages the types for generation of the persistent objects. That's the whole job. She runs the registry. Periodt.


✨ SYNOPSIS ✨

#include <persist.h>

πŸ¦‹ Classes πŸ¦‹

  • class Registration β€” this one manages a registration to the typemanager, and the whole reason she exists is attempting to remove problems with the optimisers. no cap, the optimisers were being messy and this is the fix.

🌈 Public Types 🌈

  • typedef std::map< String, NewBaseObjectFunction > StringFunctionMap β€” a map from String to NewBaseObjectFunction, exactly like it sounds.

πŸ‘‘ Static Public Member Functions πŸ‘‘

  • static void add (const char *name, NewBaseObjectFunction construction) β€” this adds a new construction function to the type manager.
  • static void remove (const char *name) β€” and this one removes a type from the managers lists.
  • static BaseObject * createInstanceOf (const char *name) β€” this function creates a new object of the required type and returns a pointer to it.

πŸ’… Detailed Description πŸ’…

This class manages the types for generation of the persistent objects. Say it with me. She's the type manager for the persistence engine, and she is thriving.

Here's the cute part: its data structures are managed automatically by the system. You don't hand-hold them, bestie. They are implicitly filled by the constructors who declare classes to the system. So the constructors do the declaring, and the system does the bookkeeping. It's giving teamwork, it's giving "I don't have to lift a finger" πŸ’…

Author: Daniel Silverstone β€” ty for your service, icon 🫢

Type manager for persistence engine.

🧚 Member Typedef Documentation 🧚

⭐ typedef std::map<String,NewBaseObjectFunction> ost::TypeManager::StringFunctionMap

Yeah. That's the typedef. It's a map from String to NewBaseObjectFunction, and that's all the lore we have on her.


πŸ’€ Member Function Documentation πŸ’€

πŸ”₯ static void ost::TypeManager::add (const char * name, NewBaseObjectFunction construction) [static]

This adds a new construction function to the type manager. You bring the name, you bring the construction function, she files it away. Simple as that, no drama 🌸

🌟 static BaseObject* ost::TypeManager::createInstanceOf (const char * name) [static]

This function creates a new object of the required type and returns a pointer to it.

⚠️ Heads up bestie: NULL is returned if we couldn't find the type. So like, always check your pointer before you go dereferencing it, because a NULL deref is not the vibe. Check it. Every time. 😭

πŸ’œ static void ost::TypeManager::remove (const char * name) [static]

And this one removes a type from the managers lists. She's out. Gone. Removed from the lists. Bye πŸ’…


🌈 Author 🌈

Generated automatically by Doxygen for GNU CommonC++ from the source code. So like, Doxygen wrote this, not a human, but we're making it cute anyway πŸ’–


okay that's the whole page, bestie!! πŸŽ€

signing off: this was GNU CommonC++'s ost::TypeManager(3), dated Sun Dec 27 2020 β€” yeah she's a little vintage but she still ate ✨ mwah, go register some types, ily πŸ’–πŸ¦‹

πŸ“¦ where this page comes from