Classes
- struct cnx_adopt_lock_t
cnx_
is a tag type intended for use with scoped lock guards such asadopt_ lock_ t CnxUniqueLock
andCnxSharedLock
, 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 CnxUniqueLock
andCnxSharedLock
, 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 CnxUniqueLock
andCnxSharedLock
, 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
CnxAllocator
is 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
CnxClock
trait 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
CnxCondvar
provides 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
CnxDuration
represents a duration in a particular unit of time ACnxDuration
occurs 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
CnxError
provides 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
CnxFormatContext
is the context type used to store parsed format specifier state for passing to the formatting functionsCnxFormat.format
andCnxFormat.format_with_allocator
. - struct CnxJThread A
CnxJThread
is 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
CnxMutex
is 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
CnxRatio
is a representation of an exact fraction - struct CnxRecursiveMutex
CnxRecursiveMutex
is 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, aCnxRecursiveMutex
would make this type of algorithm possible and prevent the thread from deadlocking itself. - struct CnxRecursiveTimedMutex
CnxRecursiveTimedMutex
is 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
CnxSharedLock
provides 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 theCnxSharedLock
exits scope. - struct CnxSharedMutex
CnxSharedMutex
is the generic (it's not timed or recursive) reader-writer mutex provided by Cnx. It's directly comparable to C++'sstd::shared_mutex
and is suitable for any situation where a reader-writer mutex is necessary. - struct CnxSharedMutexInterface
- struct CnxSharedTimedMutex
CnxSharedTimedMutex
is 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, aCnxSharedTimedMutex
would be the appropriate mutex type to use. - struct CnxString Cnx string type
CnxString
is a bounds safe, allocator aware, potentially dynamically allocated string type with significantly improved ergonomics overconst char*
s (akacstring
s), but maintains compatibility with them (CnxString
is always null terminated). Provides similar functionality to C++'sstd::string
, but in C. - struct CnxStringConstIterator Cnx string const iterator storage type
CnxStringIterator
is the underlying storage type used byCnxString
for its const iterator type (CnxRandomAccessIterator(const_
)char_ ptr) - struct CnxStringIterator Cnx string iterator storage type
CnxStringIterator
is the underlying storage type used byCnxString
for 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
CnxStringViewIterator
is the underlying storage type used byCnxStringView
for its const iterator type (CnxRandomAccessIterator(const_
)char_ ptr) - struct CnxTimedMutex
CnxTimedMutex
is 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, aCnxTimedMutex
would be the appropriate mutex type to use. - struct CnxTimePoint
CnxTimePoint
represents a specific point in time, since the UNIX epoch, represented in a particular level of precision - struct CnxUniqueLock
CnxUniqueLock
provides 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 theCnxUniqueLock
exits scope.