libcommonc++  0.7
Common.h++ File Reference
#include <cstddef>
#include <sys/types.h>
#include <pthread.h>
#include <commonc++/Integers.h++>
Include dependency graph for Common.h++:

Go to the source code of this file.

Namespaces

 ccxx
 

Macros

#define CCXX_VERSION   0x00000606
 Library version identifier. More...
 
#define CCXX_VERSION_MAJOR   ((uint_t)((CCXX_VERSION >> 16) & 0xFF))
 
#define CCXX_VERSION_MINOR   ((uint_t)((CCXX_VERSION >> 8) & 0xFF))
 
#define CCXX_VERSION_MICRO   ((uint_t)(CCXX_VERSION & 0xFF))
 
#define CCXX_OS_POSIX
 Defined if the host system is a POSIX OS. More...
 
#define COMMONCPP_API
 
#define COMMONCPPDB_API
 
#define COMMONCPPJVM_API
 
#define COMMONCPPXML_API
 
#define ___DEPRECATED(DECL)   DECL
 Macro for tagging functions and classes as "deprecated". More...
 
#define ___UNUSED
 Macro for tagging parameters and variables as "unused". More...
 
#define ___NORETURN(DECL)   DECL
 Macro for tagging functions as never returning. More...
 
#define ___PRINTF(M, N)
 
#define CCXX_INVALID_FILE_HANDLE   (-1)
 
#define NUL   '\0'
 The NUL character (ASCII value 0). More...
 
#define CCXX_LENGTHOF(A)   (sizeof(A) / sizeof(A[0]))
 Calculates the length of (the number of elements in) the statically-allocated array A. More...
 
#define CCXX_OFFSETOF(S, F)   ((size_t)(((void *)(&(((S *)NULL)->F))) - ((void *)NULL)))
 Computes the offset, in bytes, of the field F in the aggregate type S. More...
 
#define CCXX_ZERO(V)   (std::memset(&(V), 0, sizeof(V)))
 Zero the memory occupied by the variable V. More...
 
#define __CCXX_STRINGIFY__(S)   #S
 
#define CCXX_STRINGIFY(S)   __CCXX_STRINGIFY__(S)
 Evaulates to a string constant representation of S. More...
 
#define __CCXX_UNIQUE_VARNAME__(pfx, id, sfx)   pfx ## _ ## id ## _ ## sfx
 
#define CCXX_UNIQUE_VARNAME(pfx, id, sfx)   __CCXX_UNIQUE_VARNAME__(pfx, id, sfx)
 
#define CCXX_STATIC_INITIALIZER
 Introduces a static initializer code block. More...
 
#define CCXX_COPY_DECLS(CLASS)
 Inlines declarations of a copy constructor and assignment operator for the class CLASS. More...
 
#define CCXX_PIMPL_DECL(TYPE)
 
#define CCXX_PIMPL(TYPE)   TYPE ## Private *pimpl = this->pimpl_;
 
#define CCXX_FWD_DECL(CLASS)   namespace ccxx { class CLASS; };
 Inline a forward-declaration for the commonc++ class CLASS. More...
 

Typedefs

typedef uint16_t char16_t
 A UTF-16 character. More...
 
typedef uint32_t char32_t
 A UTF-32 character. More...
 
typedef pid_t ProcessHandle
 
typedef pid_t ProcessID
 
typedef pthread_t ThreadHandle
 
typedef pthread_t ThreadID
 
typedef int FileHandle
 

Enumerations

enum  Priority {
  PrioLowest, PrioLow, PrioNormal, PrioHigh,
  PrioHighest
}
 Thread and Process priority levels. More...
 
enum  Endianness { BigEndian = 0, LittleEndian = 1 }
 Byte endianness. More...
 

Macro Definition Documentation

◆ ___DEPRECATED

#define ___DEPRECATED (   DECL)    DECL

Macro for tagging functions and classes as "deprecated".

◆ ___NORETURN

#define ___NORETURN (   DECL)    DECL

Macro for tagging functions as never returning.

◆ ___PRINTF

#define ___PRINTF (   M,
 
)

◆ ___UNUSED

#define ___UNUSED

Macro for tagging parameters and variables as "unused".

◆ __CCXX_STRINGIFY__

#define __CCXX_STRINGIFY__ (   S)    #S

◆ __CCXX_UNIQUE_VARNAME__

#define __CCXX_UNIQUE_VARNAME__ (   pfx,
  id,
  sfx 
)    pfx ## _ ## id ## _ ## sfx

◆ CCXX_COPY_DECLS

#define CCXX_COPY_DECLS (   CLASS)
Value:
CLASS(const CLASS &other); \
CLASS& operator=(const CLASS &other);

Inlines declarations of a copy constructor and assignment operator for the class CLASS.

◆ CCXX_FWD_DECL

#define CCXX_FWD_DECL (   CLASS)    namespace ccxx { class CLASS; };

Inline a forward-declaration for the commonc++ class CLASS.

◆ CCXX_INVALID_FILE_HANDLE

#define CCXX_INVALID_FILE_HANDLE   (-1)

◆ CCXX_LENGTHOF

#define CCXX_LENGTHOF (   A)    (sizeof(A) / sizeof(A[0]))

Calculates the length of (the number of elements in) the statically-allocated array A.

◆ CCXX_OFFSETOF

#define CCXX_OFFSETOF (   S,
 
)    ((size_t)(((void *)(&(((S *)NULL)->F))) - ((void *)NULL)))

Computes the offset, in bytes, of the field F in the aggregate type S.

◆ CCXX_OS_POSIX

#define CCXX_OS_POSIX

Defined if the host system is a POSIX OS.

◆ CCXX_PIMPL

#define CCXX_PIMPL (   TYPE)    TYPE ## Private *pimpl = this->pimpl_;

◆ CCXX_PIMPL_DECL

#define CCXX_PIMPL_DECL (   TYPE)
Value:
class TYPE ## Private; \
TYPE ## Private *pimpl_;

◆ CCXX_STATIC_INITIALIZER

#define CCXX_STATIC_INITIALIZER
Value:
static void __ccxx_static_init__(void); \
static bool __ccxx_static_init_done__ = (__ccxx_static_init__(), true); \
static void __ccxx_static_init__(void)

Introduces a static initializer code block.

◆ CCXX_STRINGIFY

#define CCXX_STRINGIFY (   S)    __CCXX_STRINGIFY__(S)

Evaulates to a string constant representation of S.

◆ CCXX_UNIQUE_VARNAME

#define CCXX_UNIQUE_VARNAME (   pfx,
  id,
  sfx 
)    __CCXX_UNIQUE_VARNAME__(pfx, id, sfx)

◆ CCXX_VERSION

#define CCXX_VERSION   0x00000606

Library version identifier.

The three low-order bytes represent the major, minor, and micro version numbers (e.g., 0x00000602 represents version 0.6.2) The remaining byte is reserved for future use.

◆ CCXX_VERSION_MAJOR

#define CCXX_VERSION_MAJOR   ((uint_t)((CCXX_VERSION >> 16) & 0xFF))

◆ CCXX_VERSION_MICRO

#define CCXX_VERSION_MICRO   ((uint_t)(CCXX_VERSION & 0xFF))

◆ CCXX_VERSION_MINOR

#define CCXX_VERSION_MINOR   ((uint_t)((CCXX_VERSION >> 8) & 0xFF))

◆ CCXX_ZERO

#define CCXX_ZERO (   V)    (std::memset(&(V), 0, sizeof(V)))

Zero the memory occupied by the variable V.

◆ COMMONCPP_API

#define COMMONCPP_API

◆ COMMONCPPDB_API

#define COMMONCPPDB_API

◆ COMMONCPPJVM_API

#define COMMONCPPJVM_API

◆ COMMONCPPXML_API

#define COMMONCPPXML_API

◆ NUL

#define NUL   '\0'

The NUL character (ASCII value 0).