libUTL++
utl Namespace Reference

UTL++ namespace. More...

Classes

class  AccessDeniedEx
 Access denied exception More...
 
class  AddressInUseEx
 Address in use exception More...
 
class  AddressNotAvailableEx
 Address not available exception More...
 
class  AddressOrdering
 Address-based object ordering. More...
 
class  And
 Logical and predicate. More...
 
class  Application
 Application base class. More...
 
class  ArithContext
 Statistical context for ArithmeticEncoder. More...
 
class  ArithmeticEncoder
 DCC95 arithmetic coder. More...
 
class  Array
 SortedCollection that stores objects in an array. More...
 
class  ArrayIt
 Random-access Array iterator. More...
 
class  AutoPtr
 A "smart" pointer that can also be dumb. More...
 
class  Base64decode
 Decode binary data that was encoded using Base64 (the MIME / RFC 2045 encoding). More...
 
class  Base64encode
 Encode binary data using Base64 (the MIME / RFC 2045 encoding). More...
 
class  Base64encoder
 Base64 encoder/decoder stream. More...
 
class  BBcodeParser
 BBCode parser. More...
 
class  BidIt
 Bi-directional iterator abstraction. More...
 
class  BinaryData
 Vector of bytes. More...
 
struct  binaryFunction
 Abstraction for binary functions. More...
 
class  BinaryPredicate
 Abstraction for two-parameter predicates. More...
 
class  BinTree
 Binary tree abstraction. More...
 
class  BinTreeBfsIt
 Breadth-first BinTree iterator. More...
 
class  BinTreeIt
 In-order bi-directional BinTree iterator. More...
 
class  BinTreeNode
 Binary tree node. More...
 
class  BitArray
 Array of n-bit values. More...
 
class  BitArrayElem
 Reference to a value stored in a BitArray. More...
 
class  Bool
 Boolean value. More...
 
class  BoolToggle
 Toggle a boolean value RAII-style. More...
 
class  BoyerMooreSearch
 Boyer-Moore string search. More...
 
class  BufferedFDstream
 Buffered stream with file descriptor. More...
 
class  BufferedFileStream
 Buffered disk file stream. More...
 
class  BufferedSSLsocket
 Buffered SSL socket stream. More...
 
class  BufferedStream
 Buffered stream. More...
 
class  BufferedTCPsocket
 Buffered TCP socket stream. More...
 
class  BWTencoder
 BWT-based coder. More...
 
class  Bytes
 Number of bytes. More...
 
class  CachedObject
 Cached object. More...
 
class  Char
 Character value. More...
 
class  CmdLineArgs
 Parse command-line arguments. More...
 
class  Collection
 A collection of objects. More...
 
struct  comparisonFunctor
 Object comparison evaluator. More...
 
class  ComparisonPredicate
 Abstraction for comparison predicates. More...
 
class  ConcurrentQueue
 Thread-safe queue structure. More...
 
class  ConcurrentQueue_mutex
 utl::ConcurrentQueue that uses mutexes for the producer & consumer locks. More...
 
class  ConditionVar
 Condition variable. More...
 
class  ConnectionRefusedEx
 Connection refused exception More...
 
class  ConnectionResetEx
 Connection reset by peer exception More...
 
class  CRC32
 Generate CRC-32 checksums. More...
 
class  DBconnection
 Database connection. More...
 
class  DBfield
 Field in a DBresult tuple. More...
 
class  DBresult
 Database command result. More...
 
class  DBresultIterator
 Query result iterator. More...
 
class  Decimal
 Fixed-point decimal number. More...
 
class  Deque
 A sequence of objects permitting efficient insertion and removal at either end. More...
 
class  DequeIt
 Deque iterator. More...
 
class  Directory
 Directory filesystem object. More...
 
class  Duration
 Duration of time. More...
 
class  Encoder
 Encoder/decoder abstraction. More...
 
struct  equals
 Object comparison predicate evaluator that returns the value of (lhs == rhs). More...
 
class  EqualTo
 Equal-To predicate. More...
 
class  Exception
 Root of UTL++ exception class hierarchy. More...
 
class  ExtArray
 Externally stored array of objects. More...
 
class  Factory
 Object creation abstraction. More...
 
class  FastCGIserver
 Abstract base for a FastCGI server (responder). More...
 
class  FDstream
 Stream with file descriptor. More...
 
class  File
 File in a filesystem. More...
 
class  FileExistsEx
 File already exists exception More...
 
class  FileNotFoundEx
 File not found exception More...
 
class  FileSpec
 FileSpec does shell-style filename globbing. More...
 
class  FileStream
 Disk file stream. More...
 
class  FlagGuard
 Flag guard. More...
 
class  FlagsMI
 Mix-in to provide 64-bits for space-efficient storage of up to 64 boolean flags. More...
 
class  Float
 Floating point number. More...
 
class  FSobject
 Filesystem object. More...
 
class  FSobjectFilter
 Filesystem object filter. More...
 
class  FSobjectOrdering
 Filesystem object ordering. More...
 
class  FwdIt
 Forward iterator abstraction. More...
 
class  Graph
 Graph (directed or undirected). More...
 
class  GreaterThan
 Greater-Than predicate. More...
 
class  GreaterThanOrEqualTo
 Greater-Than-Or-Equal-To predicate. More...
 
class  HashFunction
 Hash function. More...
 
class  Hashtable
 Chained hashing collection. More...
 
class  HashtableIt
 Bi-directional Hashtable iterator. More...
 
class  Heap
 Heap data structure. More...
 
class  HeapIt
 Bi-directional Heap iterator. More...
 
class  HostLookupEx
 Host lookup failure exception More...
 
class  HostNoAddressEx
 Host has no address exception More...
 
class  HostNotFoundEx
 Host not found exception More...
 
class  HostOS
 Abstraction for common OS functionality. More...
 
class  HostOSEx
 Host OS exception (abstract) More...
 
class  HttpChunkWriter
 HTTP Chunked Transfer Encoder. More...
 
class  HttpRequest
 HTTP request. More...
 
class  HttpResponse
 HTTP response. More...
 
class  HuffmanEncoder
 Adaptive Huffman coder. More...
 
class  IllegalValueEx
 Illegal value exception. More...
 
class  InetHostAddress
 Internet host address. More...
 
class  InetHostname
 Internet host name. More...
 
class  Int
 32-bit signed integer. More...
 
class  Integer
 Integer value. More...
 
class  InterruptedSyscallEx
 Interrupted system call exception More...
 
class  InvalidAddressEx
 Invalid address/descriptor exception More...
 
class  InvertedKeyOrdering
 Inverted key-based object ordering. More...
 
class  InvertedNaturalOrdering
 Inverted natural object ordering. More...
 
class  IOmux
 Stream (de)-multiplexor. More...
 
class  IsA
 is-A predicate. More...
 
class  KeyOrdering
 Key-based object ordering. More...
 
struct  lessThan
 Object comparison predicate evaluator that returns the value of (lhs < rhs). More...
 
class  LessThan
 Less-Than predicate. More...
 
class  LessThanOrEqualTo
 Less-Than-Or-Equal-To predicate. More...
 
class  LinuxHostOS
 Encapsulate common UNIX OS functionality. More...
 
class  List
 Doubly-linked list. More...
 
class  ListIt
 Bi-directional List iterator. More...
 
class  ListNode
 List node. More...
 
class  LocalServerSocket
 Local host server socket. More...
 
class  LocalSocket
 Local host socket. More...
 
class  LogMgr
 Manage application event logging. More...
 
class  LZencoder
 LZ77-based compressor. More...
 
class  Mapping
 Abstraction for object->object mapping. More...
 
class  MaxObject
 Sentinel maximum value. More...
 
class  MD5
 Generate MD5 checksums. More...
 
class  MD5sum
 Store MD5 checksum. More...
 
class  MemStream
 Memory stream. More...
 
class  MinGWhostOS
 MinGW Host OS functionality. More...
 
class  MultiKeyObject
 Allows multi-key sort algorithms to be used with objects. More...
 
class  MultiKeyOrdering
 Abstract base for multi-key orderings. More...
 
class  Mutex
 MUTual EXclusion device. More...
 
class  MutexGuard
 Acquire/release a Mutex RAII-style. More...
 
class  NamedObjectMI
 Named object mix-in. More...
 
class  NaturalOrdering
 Natural object ordering. More...
 
class  NetCmdServer
 Abstract base for networked server that accepts commands represented as Array objects. More...
 
class  NetServer
 Abstract base for multi-threaded network server. More...
 
class  NetServerClient
 Client connection to NetServer. More...
 
class  NetworkEx
 Network exception (abstract) More...
 
class  NetworkUnreachableEx
 Network unreachable exception More...
 
class  NonDirectoryComponentEx
 Non-directory component exception More...
 
class  Not
 Logical not predicate. More...
 
class  Number
 Numeric value. More...
 
class  Object
 Root of UTL++ class hierarchy. More...
 
class  ObjectCache
 LRU object cache. More...
 
class  ObjectRegistry
 Object registry. More...
 
class  ObjectSpan
 Span of object-derived objects. More...
 
class  Or
 Logical or predicate. More...
 
class  Ordering
 Object comparison abstraction. More...
 
class  OStimer
 Measure CPU time. More...
 
class  Pair
 Simple container for two objects. More...
 
class  ParseEx
 Parse exception. More...
 
class  ParseNode
 Parse-tree node. More...
 
class  Pathname
 Filesystem pathname. More...
 
class  PointerIntPair
 (Pointer,Int) pair. More...
 
class  PointerIntPairBase
 Non-template base class for PointerIntPair. More...
 
struct  PointerLikeTraits
 Pointer-like traits. More...
 
class  Predicate
 Logical predicate abstraction. More...
 
struct  Printf
 Provide printf formatting strings for common types. More...
 
class  PriorityQueue
 Priority queue. More...
 
class  Queue
 FIFO (first-in, first-out) data structure. More...
 
class  RandIt
 Random-access iterator abstraction. More...
 
class  RBtree
 Red/black tree. More...
 
class  RBtreeNode
 Red/black tree node. More...
 
class  RDparser
 Recursive-descent parser. More...
 
class  RDparserEx
 Base class for exceptions thrown by RDparser. More...
 
class  ReCaptcha
 ReCaptcha response verifier. More...
 
class  Regex
 Regular expression. More...
 
class  RingBuffer
 Thread-safe fixed-size queue. More...
 
class  RLencoder
 Run-length coder. More...
 
class  RunTimeClass
 Store information about a class. More...
 
class  RWlock
 Read/write lock. More...
 
class  RWlockGuard
 Acquire/release a RWlock RAII-style. More...
 
class  RWlockLF
 Read/write lock (lock-free implementation). More...
 
class  RWlockLFguard
 Acquire/release a RWlockLF RAII-style. More...
 
class  ScanEx
 Scan exception. More...
 
class  Semaphore
 Counter for resources shared between threads. More...
 
class  ServerSocket
 Local host server socket. More...
 
class  SHA256
 Compute SHA256 cryptographic hash. More...
 
class  SHA256sum
 Store a SHA256 sum. More...
 
class  SkipList
 Skip list. More...
 
class  SkipListIt
 Bi-directional SkipList iterator. More...
 
class  SkipListNode
 SkipList node. More...
 
class  SlistNode
 Singly-linked list node. More...
 
class  SortedCollection
 Abstraction for a Collection whose objects may be sorted. More...
 
class  Span
 Span of values. More...
 
class  SpanAllocator
 Span allocator. More...
 
class  SpanCol
 Span collection. More...
 
class  SpanSizeOrdering
 Order spans by size. More...
 
class  SSLsocket
 Secure socket. More...
 
class  Stack
 LIFO (last-in, first-out) data structure. More...
 
class  Stream
 Stream I/O abstraction. More...
 
class  StreamEOFex
 Stream EOF exception More...
 
class  StreamErrorEx
 Stream I/O error exception More...
 
class  StreamEx
 Stream exception (abstract) More...
 
class  StreamSerializeEx
 Stream serialization exception More...
 
class  String
 Character string. More...
 
class  StringEscape
 Character-based substitution. More...
 
class  StringSet
 Set of strings. More...
 
class  StringTokenizer
 String tokenizer. More...
 
class  StringTranslator
 String translator. More...
 
class  StringVars
 A set of (variable-name, variable-value) tuples. More...
 
struct  subtract
 Subtraction function. More...
 
struct  subtractReverse
 Reverse subtraction function. More...
 
class  Symlink
 Filesystem sym-link. More...
 
class  SyslogStream
 Syslog stream. More...
 
class  TArray
 Template version of Array. More...
 
class  TBidIt
 Templated proxy for BidIt. More...
 
class  TCollection
 Templated proxy for Collection. More...
 
class  TConcreteRunTimeClass
 Encapsulate class-related knowledge for concrete classes. More...
 
class  TCPserverSocket
 TCP server socket. More...
 
class  TCPsocket
 TCP socket. More...
 
class  TDeque
 Template version of Deque. More...
 
class  TDequeIt
 Template version of DequeIt. More...
 
class  TFactory
 Template version of Factory. More...
 
class  TFwdIt
 Templated proxy for FwdIt. More...
 
class  THashtable
 Template version of Hashtable. More...
 
class  THashtableIt
 Template version of HashtableIt. More...
 
class  THeap
 Template version of Heap. More...
 
class  THeapIt
 Template version of HeapIt. More...
 
class  Thread
 Thread of execution. More...
 
class  ThreadCancelledEx
 Thread cancelled exception More...
 
class  Time
 Date/time. More...
 
class  TimeSpan
 Time span. More...
 
class  TList
 Template version of List. More...
 
class  TListIt
 Template version of ListIt. More...
 
class  Token
 Scanned token. More...
 
class  Tokenizer
 Stream tokenizer. More...
 
class  TokenizerTokens
 Store tokens collected by Tokenizer. More...
 
class  TRandIt
 Templated proxy for RandIt. More...
 
class  Translator
 Simple translator. More...
 
class  TRBtree
 Template version of RBtree. More...
 
class  TRBtreeIt
 Template version of RBtreeIt. More...
 
class  TRunTimeClass
 Template version of RunTimeClass. More...
 
class  TSkipList
 Template version of SkipList. More...
 
class  TSkipListIt
 Template version of SkipListIt. More...
 
class  TSortedCollection
 Templated proxy for SortedCollection. More...
 
class  TypeOrdering
 Order objects by type name first, and use the given ordering to compare objects of the same type. More...
 
class  Uint
 64-bit unsigned integer. More...
 
class  UnaryPredicate
 Abstraction for single-parameter predicates. More...
 
class  UnixModeMask
 Unix file mode mask. More...
 
class  UnknownEx
 Unknown exception. More...
 
class  UnknownHostOSEx
 Unknown host OS exception More...
 
class  URI
 Generic URI (Universal Resource Identifier). More...
 
class  Vector
 A sequence of same-type objects. More...
 
class  Vector1d
 One-dimensional vector. More...
 
class  Vector2d
 Two-dimensional vector. More...
 
class  Vector3d
 Three-dimensional vector. More...
 
class  VectorMD
 Abstract base for n-dimensional vectors. More...
 
class  Vertex
 Graph vertex. More...
 

Typedefs

typedef double double_t
 Floating-point value.
 
typedef unsigned char byte_t
 Unsigned character.
 
typedef signed char char_t
 Signed character.
 
typedef unsigned short ushort_t
 Unsigned short integer.
 
typedef signed short short_t
 Signed short integer.
 
typedef unsigned int uint_t
 Unsigned integer.
 
typedef signed int int_t
 Signed integer.
 
typedef unsigned long ulong_t
 Unsigned long integer.
 
typedef signed long long_t
 Signed long integer.
 
typedef unsigned char uint8_t
 Unsigned 8-bit integer.
 
typedef signed char int8_t
 Signed 8-bit integer.
 
typedef unsigned short uint16_t
 Unsigned 16-bit integer.
 
typedef signed short int16_t
 Signed 16-bit integer.
 
typedef unsigned int uint32_t
 Unsigned 32-bit integer.
 
typedef signed int int32_t
 Signed 32-bit integer.
 
typedef unsigned long uint64_t
 Unsigned 64-bit integer.
 
typedef long int64_t
 Signed 64-bit integer.
 

Enumerations

enum  cmp_t {
  cmp_lessThan, cmp_lessThanOrEqualTo, cmp_equalTo, cmp_greaterThan,
  cmp_greaterThanOrEqualTo
}
 Comparison operators. More...
 
enum  find_t { find_any = 0, find_first = 1, find_last = 2, find_ip = 3 }
 Find strategy. More...
 
enum  io_t { io_null = 0, io_rd = 1, io_wr = 2, io_rdwr = 3 }
 I/O flags. More...
 
enum  serialize_t { ser_readable = 1, ser_compact = 2, ser_nonportable = 4, ser_default = 8 }
 Specifies a serialization mode. More...
 
enum  cache_t { cache_write_thru, cache_write_back }
 Cache write policy. More...
 
enum  db_field_t {
  dbf_string, dbf_bool, dbf_int32, dbf_int64,
  dbf_double, dbf_decimal, dbf_dateTime, dbf_undefined
}
 Database field type. More...
 
enum  db_result_status_t { dbr_ok, dbr_nonfatal_error, dbr_fatal_error, dbr_undefined }
 Database command status. More...
 
enum  fs_flags_t { fs_create = 4, fs_append = 8, fs_trunc = 16, fs_clobber = 32 }
 FileStream flags. More...
 
enum  ios_flg_t { io_eof = 3, io_error = 4, io_bol = 5, io_lineBuffered = 6 }
 Stream flags. More...
 
enum  span_op_t { span_overlaps, span_contains, span_contained_in }
 Span relationships. More...
 
enum  sort_t {
  sort_heapSort, sort_insertionSort, sort_mergeSort, sort_quickSort,
  sort_none
}
 Specifies a sort algorithm. More...
 
enum  tm_day_t {
  tm_sunday, tm_monday, tm_tuesday, tm_wednesday,
  tm_thursday, tm_friday, tm_saturday
}
 Day of week. More...
 
enum  tm_month_t {
  tm_january, tm_february, tm_march, tm_april,
  tm_may, tm_june, tm_july, tm_august,
  tm_september, tm_october, tm_november, tm_december
}
 Month of year. More...
 
enum  tm_unit_t {
  tm_second, tm_minute, tm_half_hour, tm_hour,
  tm_day, tm_week, tm_month
}
 Unit of time. More...
 
enum  tm_dst_t { tm_dst_off, tm_dst_on, tm_dst_auto, tm_dst_leave }
 DST flag. More...
 

Functions

void errToEx (const utl::Object *object=nullptr)
 Convert libc's errno to an exception. More...
 
void h_errToEx (const utl::Object *object=nullptr)
 Convert libc's h_errno to an exception. More...
 
void memReportLeaks ()
 Report memory leaks.
 
void memReportLeaks (bool includeUnknown)
 Report memory leaks. More...
 
void init ()
 Initialize UTL++. More...
 
void deInit ()
 De-initialize UTL++. More...
 
bool initialized ()
 Determine whether UTL++ initialization has been done.
 
void abort (const char *filename, int lineNo, const char *text=nullptr)
 Abort the process. More...
 
void abort (const char *text)
 Abort the process. More...
 
int compare (bool lhs, bool rhs)
 Compare two boolean values. More...
 
void die (const char *filename, int lineNo, const char *text=nullptr, int exitCode=1)
 Exit the process with an error code. More...
 
void die (const char *text, int exitCode=1)
 Exit the process with an error code. More...
 
uint_t getSerializeMode ()
 Get the default serialization mode (see utl::serialize_t). More...
 
void setSerializeMode (uint_t mode)
 Set the default serialization mode (see utl::serialize_t). More...
 
void * realloc (void *ptr, size_t size, size_t newSize)
 Re-allocate the given block. More...
 
char * strdup (const char *str)
 Duplicate the given string. More...
 
SSL_CTX * sslContext ()
 Get a pointer to the global SSL context. More...
 
bool sslVerifyLocations (const char *caFile, const char *caPath)
 Set default locations for trusted CA certificates. More...
 
void serialize (bool &b, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize a boolean. More...
 
void serialize (int8_t &i, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize an 8-bit integer. More...
 
void serialize (char &c, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize a character. More...
 
void serialize (uint8_t &i, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize an 8-bit unsigned character. More...
 
void serialize (int16_t &i, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize a 16-bit integer. More...
 
void serialize (uint16_t &i, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize an unsigned 16-bit integer. More...
 
void serialize (int32_t &i, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize a 32-bit integer. More...
 
void serialize (uint32_t &i, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize an unsigned 32-bit integer. More...
 
void serialize (long &i, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize a long integer. More...
 
void serialize (ulong_t &i, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize an unsigned long integer. More...
 
void serialize (double &n, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize a double-precision floating point number. More...
 
void serialize (Object &object, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize an object. More...
 
template<typename T >
const T & min (const T &v)
 Base case for utl::min() variadic template. More...
 
template<typename T , typename... R>
const T & min (const T &a, const T &b, const R &... args)
 Return the smallest value among two or more provided values of the same type. More...
 
template<typename T >
const T & max (const T &v)
 Base case for utl::max() variadic template. More...
 
template<typename T , typename... R>
const T & max (const T &a, const T &b, const R &... args)
 Return the largest value among two or more provided values of the same type. More...
 
uint32_t nextPow2 (uint32_t n)
 Return the smallest power of 2 which is >= n.
 
uint64_t nextPow2 (uint64_t n)
 Return the smallest power of 2 which is >= n.
 
template<class T >
nextMultiple (const T &x, const T &target)
 Return the smallest number n s.t. More...
 
uint32_t nextMultipleOfPow2 (uint32_t x, uint32_t target)
 Return the smallest number n s.t. More...
 
uint64_t nextMultipleOfPow2 (uint64_t x, uint64_t target)
 Return the smallest number n s.t. More...
 
size_t allocatedSize (const Object *object)
 Compute the allocated size of an object. More...
 
template<typename T >
void arrayGrow (T *&array, size_t &arraySize, size_t minSize=size_t_max, size_t growthIncrement=size_t_max, const T *defVal=nullptr)
 Grow an array. More...
 
template<typename T >
void arrayGrow (T *&array, T *&arrayPtr, T *&arrayLim, size_t minSize=size_t_max, size_t growthIncrement=size_t_max)
 Grow an array. More...
 
template<typename T >
const T & cast (const utl::Object &object)
 Safely cast an object to the desired type. More...
 
template<typename T >
T & cast (utl::Object &object)
 Safely cast an object to the desired type. More...
 
template<typename T >
const T * cast (const utl::Object *object)
 Safely cast an object pointer to the desired type. More...
 
template<typename T >
T * cast (utl::Object *object)
 Safely cast an object pointer to the desired type. More...
 
template<typename T >
T & cast_const (const utl::Object &object)
 Safely cast an object reference to the desired type (remove const-qualifier). More...
 
template<typename T >
T * cast_const (const utl::Object *object)
 Safely cast an object pointer to the desired type (remove const-qualifier). More...
 
template<typename T >
T * clone (const T *object)
 Create a clone of the given object. More...
 
template<typename T >
int compare (const T &lhs, const T &rhs)
 Compare two objects of the same type. More...
 
int compare (const Object *lhs, const Object *rhs, const Ordering *ordering=nullptr)
 Compare two objects. More...
 
int compareNullable (const Object *lhs, const Object *rhs, const Ordering *ordering=nullptr)
 Compare two objects. More...
 
template<typename T >
int compare (const T *lhs, const T *rhs, size_t len)
 Compare two same-length arrays of objects of the same type. More...
 
template<typename T >
int compare (const T *lhs, size_t lhsLen, const T *rhs, size_t rhsLen)
 Compare two arrays of objects of the same type. More...
 
template<typename InputCont1 , typename InputCont2 >
int compare (typename InputCont1::const_iterator lhsBegin, typename InputCont1::const_iterator lhsEnd, typename InputCont2::const_iterator rhsBegin, typename InputCont2::const_iterator rhsEnd, std::function< int(typename InputCont1::value_type, typename InputCont2::value_type)> comp)
 Compare two sequences. More...
 
bool comparisonResultMatchesOp (int cmpRes, uint_t cmpOp)
 Determine whether the given comparison result is consistent with the given comparison operator. More...
 
template<typename T >
void copy (T *dest, const T *src, size_t len)
 Copy one array of objects to another. More...
 
template<class T >
bool isDivisibleBy (const T &x, const T &n)
 Determine whether x is evenly divisible by n. More...
 
template<typename T >
roundUp (const T &v, const T &m)
 Round the given value v up to the nearest multiple of m. More...
 
template<typename T >
roundDown (const T &v, const T &m)
 Round the given value v down to the nearest multiple of m. More...
 
template<typename T >
void serialize (T *array, size_t len, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize an array. More...
 
template<typename T >
void serialize (T *&object, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize an object (boxed). More...
 
template<typename T >
void serialize (T &object, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize an object (non-boxed). More...
 
template<typename T >
void serializeNullable (T *&object, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize a nullable object. More...
 
template<typename T >
void serializeBoxed (T *&object, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize a boxed object. More...
 
uint16_t reverseBytes (uint16_t n)
 Reverse the byte ordering of a 16-bit unsigned integer. More...
 
uint32_t reverseBytes (uint32_t n)
 Reverse the byte ordering of a 32-bit unsigned integer. More...
 
uint64_t reverseBytes (uint64_t n)
 Reverse the byte ordering of a 64-bit unsigned integer. More...
 
template<typename T >
void swap (T *array, size_t lhsIdx, size_t rhsIdx)
 Swap two elements of the given array. More...
 
template<typename T >
void swap (T *array, size_t lhsIdx, size_t rhsIdx, size_t size)
 Swap two sections of the given array. More...
 
void clobber ()
 Fake read/write access to all memory. More...
 
void escape (void *ptr)
 Fake read/write access to all memory, and require the object at address ptr to exist. More...
 
constexpr size_t KB (size_t n)
 Convert size in kilobytes to size in bytes. More...
 
constexpr size_t MB (size_t n)
 Convert size in megabytes to size in bytes. More...
 
constexpr size_t GB (size_t n)
 Convert size in gigabytes to size in bytes. More...
 
int list_compare (const ListNode *lhs, const ListNode *rhs, const Ordering *ordering=nullptr)
 Compare two lists. More...
 
void list_clone (ListNode *&outList, ListNode **outTail, const ListNode *list, bool owner=true)
 Make a copy of a list. More...
 
void list_serialize (ListNode *&list, ListNode **tail, bool owner, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize a list. More...
 
void list_clear (ListNode *&list, ListNode **tail, bool owner=true)
 Clear a list. More...
 
size_t list_items (const ListNode *list)
 Count the number of items in a list. More...
 
ListNodelist_tail (ListNode *list)
 Determine the tail node. More...
 
const ListNodelist_tail (const ListNode *list)
 Determine the tail node. More...
 
void list_add (ListNode *&list, ListNode **tail, const Object *object, bool sorted=false, const Ordering *ordering=nullptr)
 Add an object to a list. More...
 
bool list_remove (ListNode *&list, ListNode **tail, const Object &key, bool owner=true, bool sorted=false, const Ordering *ordering=nullptr)
 Remove the object matching the given key from the list. More...
 
void list_removeNode (ListNode *&list, ListNode **tail, ListNode *node, bool owner)
 Remove the given node from the given list. More...
 
Objectlist_find (ListNode *list, const Object &key, bool sorted=false, const Ordering *ordering=nullptr)
 Find the object matching the given key in the given list. More...
 
ListNodelist_findInsertionPoint (ListNode *list, const Object &key, bool sorted=false, const Ordering *ordering=nullptr, int *cmpRes=nullptr)
 Find the insertion point for the given key in the given list. More...
 
ListNodelist_findNode (ListNode *list, const Object &key, bool sorted=false, const Ordering *ordering=nullptr)
 Find the node whose object matches the given key. More...
 
int slist_compare (const SlistNode *lhs, const SlistNode *rhs, const Ordering *ordering=nullptr)
 Compare two lists. More...
 
void slist_clone (SlistNode *&outList, SlistNode **outTail, const SlistNode *list, bool owner=true)
 Make a copy of a list. More...
 
void slist_serialize (SlistNode *&list, SlistNode **tail, bool owner, Stream &stream, uint_t io, uint_t mode=ser_default)
 Serialize a list. More...
 
void slist_clear (SlistNode *&list, SlistNode **tail, bool owner=true)
 Clear a list. More...
 
size_t slist_items (const SlistNode *list)
 Count the number of items in a list. More...
 
SlistNodeslist_tail (SlistNode *list)
 Determine the tail node. More...
 
const SlistNodeslist_tail (const SlistNode *list)
 Determine the tail node. More...
 
void slist_add (SlistNode *&list, SlistNode **tail, const Object *object, bool sorted=false, const Ordering *ordering=nullptr)
 Add an object to a list. More...
 
bool slist_remove (SlistNode *&list, SlistNode **tail, const Object &key, bool owner=true, bool sorted=false, const Ordering *ordering=nullptr)
 Remove the object matching the given key from the list. More...
 
void slist_removeNode (SlistNode *&list, SlistNode **tail, SlistNode *node, SlistNode *prev, bool owner)
 Remove the given node from the given list. More...
 
Objectslist_find (SlistNode *list, const Object &key, bool sorted=false, const Ordering *ordering=nullptr)
 Find the object matching the given key in the given list. More...
 
SlistNodeslist_findInsertionPoint (SlistNode *list, const Object &key, bool sorted=false, const Ordering *ordering=nullptr, int *cmpRes=nullptr, SlistNode **prev=nullptr)
 Find the insertion point for the given key in the given list. More...
 
SlistNodeslist_findNode (SlistNode *list, const Object &key, bool sorted=false, const Ordering *ordering=nullptr, SlistNode **prev=nullptr)
 Find the node whose object matches the given key. More...
 
utl::BufferedStreamendl (utl::BufferedStream &stream)
 Output a newline to the stream.
 
utl::BufferedStreamendlf (utl::BufferedStream &stream)
 Output a newline to the stream and flush its output.
 
utl::BufferedStreamflush (utl::BufferedStream &stream)
 Flush the stream's output.
 
utl::Streamendl (utl::Stream &stream)
 Output a newline to the stream.
 
utl::Streamendlf (utl::Stream &stream)
 Output a newline to the stream and flush its output.
 
utl::Streamflush (utl::Stream &stream)
 Flush the stream's output.
 
size_t binarySearch (const RandIt &begin, const RandIt &end, const Object &key, const Ordering *ordering=nullptr, uint_t findType=find_first)
 Binary search an ordered sequence for a key. More...
 
void clobber (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, const Ordering *ordering=nullptr)
 Where lhs and rhs intersect, make the lhs version of the object equal to the rhs version ("clobber" it with the rhs version). More...
 
int compare (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, const Ordering *ordering=nullptr)
 Compare two sorted sequences. More...
 
void copy (FwdIt &out, const FwdIt &begin, const FwdIt &end, bool cloning=false, const Predicate *pred=nullptr, bool predVal=true)
 Copy objects from one sequence into another. More...
 
void copy (Object **out, const FwdIt &begin, const FwdIt &end, bool cloning=false, const Predicate *pred=nullptr, bool predVal=true)
 Copy objects from one sequence to another. More...
 
void copy (FwdIt &out, const Vector< Object *> &in, bool cloning=false, const Predicate *pred=nullptr, bool predVal=true)
 Copy objects from a Vector to a sequence. More...
 
size_t count (const FwdIt &begin, const FwdIt &end, const Predicate *pred=nullptr, bool predVal=true)
 Count objects that satisfy a Predicate. More...
 
void difference (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, FwdIt &out, const Ordering *ordering=nullptr, bool cloning=false, bool outIsLHS=false)
 Determine the difference between two sorted sequences. More...
 
void dump (const FwdIt &begin, const FwdIt &end, Stream &os, uint_t level=uint_t_max, bool key=false, bool printClassName=false, uint_t indent=0, const char *separator=nullptr)
 Dump objects to the given stream (with Object::dump()). More...
 
void heapSort (const BidIt &begin, const BidIt &end, const Ordering *ordering=nullptr, size_t size=size_t_max)
 Heap-sort a sequence. More...
 
void heapSort (Object **array, size_t begin, size_t end, const Ordering *ordering=nullptr)
 Heap-sort a sequence. More...
 
void insertionSort (const FwdIt &begin, const FwdIt &end, const Ordering *ordering=nullptr, size_t size=size_t_max)
 Insertion-sort a sequence. More...
 
void insertionSort (Object **array, size_t begin, size_t end, const Ordering *ordering=nullptr)
 Insertion-sort (part of) an array. More...
 
void intersect (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, FwdIt &out, const Ordering *ordering=nullptr, bool cloning=false, bool multiSet=false, bool outIsLHS=false)
 Determine the intersection of two sorted sequences. More...
 
size_t intersectCard (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, const Ordering *ordering=nullptr, bool multiSet=false)
 Determine the cardinality of the intersection of two sorted sequences. More...
 
bool intersects (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, const Ordering *ordering=nullptr)
 Determine whether the intersection of two sorted sequences is non-empty. More...
 
bool isSorted (const FwdIt &begin, const FwdIt &end, const Ordering *ordering=nullptr)
 Determine whether the given sequence is sorted. More...
 
bool isSubSet (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, const Ordering *ordering=nullptr)
 Determine whether the lhs sorted sequence is a subset of the rhs sorted sequence. More...
 
bool isSuperSet (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, const Ordering *ordering=nullptr)
 Determine whether the lhs sorted sequence is a superset of the rhs sorted sequence. More...
 
void linearSearch (const FwdIt &begin, const FwdIt &end, const Object &key, FwdIt &out, const Ordering *ordering=nullptr, uint_t findType=find_first)
 Linear search a sequence for a key. More...
 
void linearSearchSorted (const FwdIt &begin, const FwdIt &end, const Object &key, FwdIt &out, const Ordering *ordering=nullptr, uint_t findType=find_first)
 Linear search a sorted sequence for a key. More...
 
void merge (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, FwdIt &out, const Ordering *ordering=nullptr, bool cloning=false)
 Merge two sorted sequences into a single sorted sequence. More...
 
void mergeSort (const FwdIt &begin, const FwdIt &end, const Ordering *ordering=nullptr, size_t size=size_t_max)
 Merge-sort a sequence. More...
 
void mergeSort (Object **array, size_t begin, size_t end, const Ordering *ordering=nullptr)
 Merge-sort (part of) an array. More...
 
void multiKeyQuickSort (const FwdIt &begin, const FwdIt &end, bool key=true, bool reverse=false, size_t size=size_t_max)
 Multi-key quick-sort a sequence. More...
 
void quickSort (const FwdIt &begin, const FwdIt &end, const Ordering *ordering=nullptr, size_t size=size_t_max)
 Quick-sort a sequence. More...
 
void quickSort (Object **array, size_t begin, size_t end, const Ordering *ordering=nullptr)
 Quick-sort (part of) a sequence. More...
 
void remove (FwdIt &begin, const FwdIt &end, bool cmp=false, const Predicate *pred=nullptr, bool predVal=false)
 Remove objects from a sequence. More...
 
void reverse (const BidIt &begin, const BidIt &end)
 Reverse a sequence. More...
 
void serializeIn (FwdIt &out, size_t numItems, Stream &is, uint_t mode=ser_default, const RunTimeClass *rtc=nullptr)
 Serialize objects from an input stream. More...
 
void serializeOut (const FwdIt &begin, const FwdIt &end, Stream &os, uint_t mode=ser_default, bool boxed=true)
 Serialize objects to an output stream. More...
 
void sort (const FwdIt &begin, const FwdIt &end, const Ordering *ordering=nullptr, uint_t algorithm=sort_quickSort, size_t size=size_t_max)
 Sort a sequence using a given algorithm. More...
 
void sort (Object **array, size_t begin, size_t end, const Ordering *ordering=nullptr, uint_t algorithm=sort_quickSort)
 Sort a sequence using a given algorithm. More...
 
void swap (FwdIt &lhs, FwdIt &rhs)
 Swap two objects. More...
 
void swap (RandIt &it, size_t lhsIdx, size_t rhsIdx)
 Swap two objects in a random-access sequence. More...
 
void symmetricDifference (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, FwdIt &out, const Ordering *ordering=nullptr, bool cloning=false)
 Determine the symmetric difference of two sorted sequences. More...
 
void symmetricDifference (const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, FwdIt &lhsOut, FwdIt &rhsOut, const Ordering *ordering=nullptr, bool lhsCloning=false, bool rhsCloning=false)
 Determine the symmetric difference of two sorted sequences. More...
 
String toString (const FwdIt &begin, const FwdIt &end, const String &sep, bool key=false)
 Obtain a string representation of a sequence (via Object::toString()). More...
 
void unique (const FwdIt &begin, const FwdIt &end, FwdIt &out, const Ordering *ordering=nullptr, bool cloning=false, bool outIsSrc=false)
 Remove duplicate objects from a sorted sequence. More...
 
template<class T , class P , class C >
void multiKeyInsertionSort (P *array, C cmp, size_t begin, size_t end, size_t depth=0)
 Multi-key insertion-sort (part of) the given sequence. More...
 
template<class T , class P , class C >
size_t multiKeyMedianOfThree (P *array, C cmp, size_t l, size_t m, size_t h, size_t depth=0)
 Perform median-of-three partitioning. More...
 
template<class T , class P , class C >
void multiKeyQuickSort (P *array, C cmp, size_t begin, size_t end, size_t depth=0)
 Multi-key quick-sort (part of) the given sequence. More...
 
template<class T , class C >
size_t binarySearch (const T *array, size_t begin, size_t end, const T &key, C cmpFn, uint_t findType=find_first)
 Binary search an ordered sequence for a key. More...
 

Variables

LogMgr logMgr
 Global instance of LogMgr. More...
 
const MaxObject maxObject
 Global instance of MaxObject.
 
const NaturalOrdering naturalOrdering
 Global instance of NaturalOrdering.
 
const InvertedNaturalOrdering invertedNaturalOrdering
 Global instance of InvertedNaturalOrdering.
 
const KeyOrdering keyOrdering
 Global instance of KeyOrdering.
 
const InvertedKeyOrdering invertedKeyOrdering
 Global instance of KeyOrdering.
 
const TypeOrdering typeOrdering
 Global instance of TypeOrdering.
 
const AddressOrdering addressOrdering
 Global instance of AddressOrdering.
 
BufferedFDstream cin
 Standard input.
 
BufferedFDstream cout
 Standard output.
 
BufferedFDstream cerr
 Standard error.
 
const String emptyString
 An empty string.
 
const double_t double_t_min
 Minimum double_t value.
 
const double_t double_t_max
 Maximum double_t value.
 
const byte_t byte_t_min
 Minimum byte_t value.
 
const byte_t byte_t_max
 Maximum byte_t value.
 
const char_t char_t_min
 Minimum char_t value.
 
const char_t char_t_max
 Maximum char_t value.
 
const ushort_t ushort_t_min
 Minimum ushort_t value.
 
const ushort_t ushort_t_max
 Maximum ushort_t value.
 
const short_t short_t_min
 Minimum short_t value.
 
const short_t short_t_max
 Maximum short_t value.
 
const uint_t uint_t_min
 Minimum uint_t value.
 
const uint_t uint_t_max
 Maximum uint_t value.
 
const int_t int_t_min
 Minimum int_t value.
 
const int_t int_t_max
 Maximum int_t value.
 
const ulong_t ulong_t_min
 Minimum unsigned long value.
 
const ulong_t ulong_t_max
 Maximum unsigned long value.
 
const long_t long_t_min
 Minimum long value.
 
const long_t long_t_max
 Maximum long value.
 
const size_t size_t_min
 Minimum size_t value.
 
const size_t size_t_max
 Maximum size_t value.
 
const ssize_t ssize_t_min
 Minimum ssize_t value.
 
const ssize_t ssize_t_max
 Maximum ssize_t value.
 
const uint8_t uint8_t_min
 Minimum uint8_t value.
 
const uint8_t uint8_t_max
 Maximum uint8_t value.
 
const int8_t int8_t_min
 Minimum int8_t value.
 
const int8_t int8_t_max
 Maximum int8_t value.
 
const uint16_t uint16_t_min
 Minimum uint16_t value.
 
const uint16_t uint16_t_max
 Maximum uint16_t value.
 
const int16_t int16_t_min
 Minimum int16_t value.
 
const int16_t int16_t_max
 Maximum int16_t value.
 
const uint32_t uint32_t_min
 Minimum uint32_t value.
 
const uint32_t uint32_t_max
 Maximum uint32_t value.
 
const int32_t int32_t_min
 Minimum int32_t value.
 
const int32_t int32_t_max
 Maximum int32_t value.
 
const uint64_t uint64_t_min
 Minimum uint64_t value.
 
const uint64_t uint64_t_max
 Maximum uint64_t value.
 
const int64_t int64_t_min
 Minimum int64_t value.
 
const int64_t int64_t_max
 Maximum int64_t value.
 

Detailed Description

UTL++ namespace.

Function Documentation

◆ memReportLeaks()

void utl::memReportLeaks ( bool  includeUnknown)

Report memory leaks.

Parameters
includeUnknownalso report leaks from unknown sources?

◆ min()

template<typename T >
const T& utl::min ( const T &  v)

Base case for utl::min() variadic template.

Definition at line 43 of file util_inl.h.

Referenced by compare(), min(), and utl::Span< Time, Duration >::overlapSize().

◆ max()

template<typename T >
const T& utl::max ( const T &  v)

Base case for utl::max() variadic template.

Definition at line 71 of file util_inl.h.

Referenced by max(), and utl::Span< Time, Duration >::overlapSize().

◆ list_compare()

int utl::list_compare ( const ListNode lhs,
const ListNode rhs,
const Ordering ordering = nullptr 
)

Compare two lists.

Returns
< 0 if self < rhs, 0 if self = rhs, > 0 if self > rhs
Parameters
lhshead of left-hand-side list
rhshead of right-hand-side list
ordering(optional) ordering

◆ list_clone()

void utl::list_clone ( ListNode *&  outList,
ListNode **  outTail,
const ListNode list,
bool  owner = true 
)

Make a copy of a list.

Parameters
outListhead of newly created list
outTailtail of newly created list (can be nullptr)
listhead of list to copy
ownerownership flag

◆ list_serialize()

void utl::list_serialize ( ListNode *&  list,
ListNode **  tail,
bool  owner,
Stream stream,
uint_t  io,
uint_t  mode = ser_default 
)

Serialize a list.

Parameters
listhead of list to serialize
tailtail of list to serialize (can be nullptr)
ownerownership flag
streamstream to serialize from/to
iosee utl::io_t
modesee utl::serialize_t

◆ list_clear()

void utl::list_clear ( ListNode *&  list,
ListNode **  tail,
bool  owner = true 
)

Clear a list.

Parameters
listhead of list to clear
tailtail of list to clear (can be nullptr)
owner(optional : true) ownership flag

◆ list_items()

size_t utl::list_items ( const ListNode list)

Count the number of items in a list.

Returns
item count
Parameters
listhead of list

◆ list_tail() [1/2]

ListNode* utl::list_tail ( ListNode list)

Determine the tail node.

Returns
tail node
Parameters
listhead of list

◆ list_tail() [2/2]

const ListNode* utl::list_tail ( const ListNode list)

Determine the tail node.

Returns
tail node
Parameters
listhead of list

◆ list_add()

void utl::list_add ( ListNode *&  list,
ListNode **  tail,
const Object object,
bool  sorted = false,
const Ordering ordering = nullptr 
)

Add an object to a list.

Parameters
listhead of list
tailtail of list (can be nullptr)
objectobject to be added
sorted(optional : true) add in correct order?
ordering(optional) ordering

◆ list_remove()

bool utl::list_remove ( ListNode *&  list,
ListNode **  tail,
const Object key,
bool  owner = true,
bool  sorted = false,
const Ordering ordering = nullptr 
)

Remove the object matching the given key from the list.

Returns
true if object found and removed, false otherwise
Parameters
listhead of list
tailtail of list (can be nullptr)
keysearch key
owner(optional : true) ownership flag
sorted(optional : false) sorted list?
ordering(optional) ordering

◆ list_removeNode()

void utl::list_removeNode ( ListNode *&  list,
ListNode **  tail,
ListNode node,
bool  owner 
)

Remove the given node from the given list.

Parameters
listhead of list
tailtail of list (can be nullptr)
nodenode to be removed
ownerownership flag

◆ list_find()

Object* utl::list_find ( ListNode list,
const Object key,
bool  sorted = false,
const Ordering ordering = nullptr 
)

Find the object matching the given key in the given list.

Parameters
listhead of list
keysearch key
sorted(optional : false) sorted list?
ordering(optional) ordering

◆ list_findInsertionPoint()

ListNode* utl::list_findInsertionPoint ( ListNode list,
const Object key,
bool  sorted = false,
const Ordering ordering = nullptr,
int *  cmpRes = nullptr 
)

Find the insertion point for the given key in the given list.

Returns
node that key should be inserted before/after
Parameters
listhead of list
keysearch key
sorted(optional : false) sorted list?
ordering(optional) ordering
cmpRes(optional) result of comparing returned node's object with given key

◆ list_findNode()

ListNode* utl::list_findNode ( ListNode list,
const Object key,
bool  sorted = false,
const Ordering ordering = nullptr 
)

Find the node whose object matches the given key.

Returns
found node (nullptr if none)
Parameters
listhead of list
keysearch key
sorted(optional : false) sorted list?
ordering(optional) ordering

◆ slist_compare()

int utl::slist_compare ( const SlistNode lhs,
const SlistNode rhs,
const Ordering ordering = nullptr 
)

Compare two lists.

Returns
< 0 if self < rhs, 0 if self = rhs, > 0 if self > rhs
Parameters
lhshead of left-hand-side list
rhshead of right-hand-side list
ordering(optional) ordering

◆ slist_clone()

void utl::slist_clone ( SlistNode *&  outList,
SlistNode **  outTail,
const SlistNode list,
bool  owner = true 
)

Make a copy of a list.

Parameters
outListhead of newly created list
outTailtail of newly created list (can be nullptr)
listhead of list to copy
ownerownership flag

◆ slist_serialize()

void utl::slist_serialize ( SlistNode *&  list,
SlistNode **  tail,
bool  owner,
Stream stream,
uint_t  io,
uint_t  mode = ser_default 
)

Serialize a list.

Parameters
listhead of list to serialize
tailtail of list to serialize (can be nullptr)
ownerownership flag
streamstream to serialize from/to
iosee utl::io_t
modesee utl::serialize_t

◆ slist_clear()

void utl::slist_clear ( SlistNode *&  list,
SlistNode **  tail,
bool  owner = true 
)

Clear a list.

Parameters
listhead of list to clear
tailtail of list to clear (can be nullptr)
owner(optional : true) ownership flag

Referenced by utl::Vertex::clear().

◆ slist_items()

size_t utl::slist_items ( const SlistNode list)

Count the number of items in a list.

Returns
item count
Parameters
listhead of list

◆ slist_tail() [1/2]

SlistNode* utl::slist_tail ( SlistNode list)

Determine the tail node.

Returns
tail node
Parameters
listhead of list

◆ slist_tail() [2/2]

const SlistNode* utl::slist_tail ( const SlistNode list)

Determine the tail node.

Returns
tail node
Parameters
listhead of list

◆ slist_add()

void utl::slist_add ( SlistNode *&  list,
SlistNode **  tail,
const Object object,
bool  sorted = false,
const Ordering ordering = nullptr 
)

Add an object to a list.

Parameters
listhead of list
tailtail of list (can be nullptr)
objectobject to be added
sorted(optional : true) add in correct order?
ordering(optional) ordering

Referenced by utl::Vertex::addDirectedEdge(), and utl::Vertex::addUndirectedEdge().

◆ slist_remove()

bool utl::slist_remove ( SlistNode *&  list,
SlistNode **  tail,
const Object key,
bool  owner = true,
bool  sorted = false,
const Ordering ordering = nullptr 
)

Remove the object matching the given key from the list.

Returns
true if object found and removed, false otherwise
Parameters
listhead of list
tailtail of list (can be nullptr)
keysearch key
owner(optional : true) ownership flag
sorted(optional : false) sorted list?
ordering(optional) ordering

Referenced by utl::Vertex::removeDirectedEdge(), and utl::Vertex::removeUndirectedEdge().

◆ slist_removeNode()

void utl::slist_removeNode ( SlistNode *&  list,
SlistNode **  tail,
SlistNode node,
SlistNode prev,
bool  owner 
)

Remove the given node from the given list.

Parameters
listhead of list
tailtail of list (can be nullptr)
nodenode to be removed
prevnode's predecessor
ownerownership flag

◆ slist_find()

Object* utl::slist_find ( SlistNode list,
const Object key,
bool  sorted = false,
const Ordering ordering = nullptr 
)

Find the object matching the given key in the given list.

Parameters
listhead of list
keysearch key
sorted(optional : false) sorted list?
ordering(optional) ordering

Referenced by utl::Vertex::find().

◆ slist_findInsertionPoint()

SlistNode* utl::slist_findInsertionPoint ( SlistNode list,
const Object key,
bool  sorted = false,
const Ordering ordering = nullptr,
int *  cmpRes = nullptr,
SlistNode **  prev = nullptr 
)

Find the insertion point for the given key in the given list.

Returns
node that key should be inserted before/after
Parameters
listhead of list
keysearch key
sorted(optional : false) sorted list?
ordering(optional) ordering
cmpRes(optional) result of comparing returned node's object with given key
prev(optional) new node's predecessor

◆ slist_findNode()

SlistNode* utl::slist_findNode ( SlistNode list,
const Object key,
bool  sorted = false,
const Ordering ordering = nullptr,
SlistNode **  prev = nullptr 
)

Find the node whose object matches the given key.

Returns
found node (nullptr if none)
Parameters
listhead of list
keysearch key
sorted(optional : false) sorted list?
ordering(optional) ordering
prev(optional) node's predecessor

Variable Documentation

◆ logMgr

LogMgr utl::logMgr

Global instance of LogMgr.

Referenced by utl::LogMgr::putLine().