.TH "cereal::detail::StaticObject< T >" 3 "Mon Oct 26 2026 02:55:37" "cereal" \" -*- nroff -*- .ad l .nh .SH NAME cereal::detail::StaticObject< T > \- A static, pre-execution object\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .SS "Classes" .in +1c .ti -1c .RI "class \fBLockGuard\fP" .br .RI "A class that acts like std::lock_guard\&. " .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static T & \fBgetInstance\fP ()" .br .ti -1c .RI "static \fBLockGuard\fP \fBlock\fP ()" .br .RI "Attempts to lock this static object for the current scope\&. " .in -1c .SH "Detailed Description" .PP .SS "template .br class cereal::detail::StaticObject< T >"A static, pre-execution object\&. This class will create a single copy (singleton) of some type and ensures that merely referencing this type will cause it to be instantiated and initialized pre-execution\&. For example, this is used heavily in the polymorphic pointer serialization mechanisms to bind various archive types with different polymorphic classes .SH "Member Function Documentation" .PP .SS "template \fBLockGuard\fP \fBcereal::detail::StaticObject\fP< T >::lock ()\fR [inline]\fP, \fR [static]\fP" .PP Attempts to lock this static object for the current scope\&. .PP \fBNote\fP .RS 4 This function is a no-op if cereal is not compiled with thread safety enabled (CEREAL_THREAD_SAFE = 1)\&. .RE .PP This function returns an object that holds a lock for this \fBStaticObject\fP that will release its lock upon destruction\&. This call will block until the lock is available\&. .SH "Author" .PP Generated automatically by Doxygen for cereal from the source code\&.