Classes
- struct cnx_adopt_lock_t
cnx_is a tag type intended for use with scoped lock guards such asadopt_ lock_ t CnxUniqueLockandCnxSharedLock, to communicate that the given mutex has already been locked and thus the guard does not need to acquire the lock itself. This is in contrast to the default behavior, where a lock guard will acquire the lock upon its construction. - struct cnx_defer_lock_t
cnx_is a tag type intended for use with scoped lock guards such asdefer_ lock_ t CnxUniqueLockandCnxSharedLock, to communicate that the guard should defer locking the given mutex until requested to do so. This is in contrast to the default behavior, where a lock guard will acquire the lock upon its construction. - struct cnx_string_vtable_t The function vector table of methods associated with
CnxString - struct cnx_stringview_vtable_t The function vector table of methods associated with
CnxStringView - struct cnx_try_lock_t
cnx_is a tag type intended for use with scoped lock guards such astry_ lock_ t CnxUniqueLockandCnxSharedLock, to communicate that the guard should only attempt to lock the given mutex (viatry_lock), and not block if lock acquisition was unsuccessful. This is in contrast to the default behavior, where a lock guard will unconditionally acquire the lock upon its construction. - struct CnxAllocator A
CnxAllocatoris a convenient abstraction for wrapping memory allocation and deallocation, making it simple and easy to write allocator-configurable and/or allocator aware software. - struct CnxClock The
CnxClocktrait defines the interface that must be implemented by any Cnx-compatible clock. It intentionally mirrors the API of C++'s standard clock types, along with some additional functionality. - struct CnxCondvar
CnxCondvarprovides a higher-level condition variable type, directly comparable to C++'sstd::condition_variable, that helps to make writing efficient multi-threaded code simpler and easier. - struct CnxDuration
CnxDurationrepresents a duration in a particular unit of time ACnxDurationoccurs in a particular unit of time (e.g. seconds, nanoseconds, or years), and can represent a positive or negative amount of that unit - struct CnxError
CnxErrorprovides an extensible, configurable type for communicating recoverable errors via error codes and error message strings - struct CnxFile Cnx type used to manage reading and writing to/from a file, the buffering associated with the file, and closing it when it's no longer used.
- struct CnxFileOptions Use to specify the access mode and behavior a file should be opened with.
- struct CnxFormat
- struct CnxFormatContext
CnxFormatContextis the context type used to store parsed format specifier state for passing to the formatting functionsCnxFormat.formatandCnxFormat.format_with_allocator. - struct CnxJThread A
CnxJThreadis the handle type for OS-level threads which are automatically joined when their handle goes out of scope and use a dedicated stop token to signal to the thread when its execution should end. - struct CnxMutex
CnxMutexis the generic higher-level mutex type provided by Cnx. It is a simple mutex type suitable for general purpose use (ie, it is not timed, recursive, etc), and is directly comparable to C++'sstd::mutex - struct CnxMutexInterface
- struct CnxRatio
CnxRatiois a representation of an exact fraction - struct CnxRecursiveMutex
CnxRecursiveMutexis a higher-level mutex type, directly comparable to C++'s std::recursive_mutex`, for use when an algorithm requires that a thread be able to lock the same mutex multiple times in its control flow. While such an algorithm would cause the thread to deadlock itself when used with a normal mutex, this is the intended task for a recursive mutex. For example, if a recursive algorithm requires synchronization using the same mutex at multiple levels of recursion, and one level of the algorithm can't release the lock before calling the next, aCnxRecursiveMutexwould make this type of algorithm possible and prevent the thread from deadlocking itself. - struct CnxRecursiveTimedMutex
CnxRecursiveTimedMutexis a higher-level mutex type for use when the properties of both a recursive and a timed mutex are necessary for the task at hand. It's directly comparable to C++'sstd::recursive_timed_mutex. It allows for both specifying a timeout for lock acquisition as well as recursive lock acquisition on the same thread. - struct CnxSharedLock
CnxSharedLockprovides scoped non-exclusive (shared) locking of higher-level mutexes (egCnxSharedMutex,CnxSharedTimedMutex) provided by Cnx. It allows for a simple, concise way to acquire the shared lock on a mutex and ensure that lock is released appropriately when theCnxSharedLockexits scope. - struct CnxSharedMutex
CnxSharedMutexis the generic (it's not timed or recursive) reader-writer mutex provided by Cnx. It's directly comparable to C++'sstd::shared_mutexand is suitable for any situation where a reader-writer mutex is necessary. - struct CnxSharedMutexInterface
- struct CnxSharedTimedMutex
CnxSharedTimedMutexis a higher-level reader-writer mutex type for use when timed backoff of mutex locking is required, and is directly comparable to C++'sstd::shared_timed_mutex. It allows for specifying a timeout, which if reached will cause execution to stop attempting to acquire the lock and signal failure to the caller, instead of blocking indefinitely until the lock was successfully acquired like a tradition mutex. For example, if an algorithm needs reader-writer synchronization, but blocking for longer than X milliseconds when trying to acquire the lock would be problematic, aCnxSharedTimedMutexwould be the appropriate mutex type to use. - struct CnxString Cnx string type
CnxStringis a bounds safe, allocator aware, potentially dynamically allocated string type with significantly improved ergonomics overconst char*s (akacstrings), but maintains compatibility with them (CnxStringis always null terminated). Provides similar functionality to C++'sstd::string, but in C. - struct CnxStringConstIterator Cnx string const iterator storage type
CnxStringIteratoris the underlying storage type used byCnxStringfor its const iterator type (CnxRandomAccessIterator(const_)char_ ptr) - struct CnxStringIterator Cnx string iterator storage type
CnxStringIteratoris the underlying storage type used byCnxStringfor its non-const iterator type (CnxRandomAccessIterator(char_)ptr) - struct CnxStringView Cnx stringview type. A stringview is a "view" into a
CnxString. It allows you to lazily inspect the contents of the string, but not modify them. It is effectively a fat pointer into the contents of the associatedCnxString - struct CnxStringViewIterator Cnx stringview const iterator storage type
CnxStringViewIteratoris the underlying storage type used byCnxStringViewfor its const iterator type (CnxRandomAccessIterator(const_)char_ ptr) - struct CnxTimedMutex
CnxTimedMutexis a higher-level mutex type for use when timed backoff of mutex locking is required, and is directly comparable to C++'sstd::timed_mutex. It allows for specifying a timeout, which if reached will cause execution to stop attempting to acquire the lock and signal failure to the caller, instead of blocking indefinitely until the lock was successfully acquired like a tradition mutex. For example, if an algorithm needs synchronization, but blocking for longer than X milliseconds when trying to acquire the lock would be problematic, aCnxTimedMutexwould be the appropriate mutex type to use. - struct CnxTimePoint
CnxTimePointrepresents a specific point in time, since the UNIX epoch, represented in a particular level of precision - struct CnxUniqueLock
CnxUniqueLockprovides scoped exclusive locking of any higher-level mutexes (egCnxMutex,CnxSharedMutex, etc.) provided by Cnx. It allows for a simple, concise way to acquire the exclusive lock on a mutex and ensure that lock is released appropriately when theCnxUniqueLockexits scope.