Giter Club home page Giter Club logo

utxx's Introduction

utxx - an open-source collection of C++ utility components

Build Status

This dual-licensed library provides a set of classes that complement C++ and boost with functionality needed by many applications.

The library is free to use under LGPLv2 license for non-commercial projects, and has a commercial open source license for commercial use (contact the author for commercial licensing details).

The components include:

  • Logging framework with pluggable back-ends using Inversion of Control design pattern
  • Custom allocators (including atomic pool allocator, stack allocator)
  • Atomic functions
  • Bitmap mask with fast iteration
  • BOOST wait_timeout, repeating timer
  • Buffer for I/O handling
  • Concurrent array/fifo/priority_queue/stack/hashmap
  • Fast delegates
  • Type conversion routines
  • Endian-handling
  • Exception error classes with dynamic number of arguments
  • Hashmap abstraction
  • UDP receiver
  • Ultra-low latency async logger
  • Math functions
  • Metaprogramming functions
  • Persistent blob and array
  • Futex signaling
  • PCAP format reader/writer
  • Throttling components
  • PID file manager
  • Variant / variant tree components
  • Exceptions with error source location
  • Reflectable enums
  • Configuration framework with option validation (SCON configuration format support)

Downloading

$ git clone [email protected]:saleyn/utxx.git

Building

To customize location of BOOST or installation prefix, create a file called .cmake-args.${HOSTNAME}. Alternatively if you are doing multi-host build with identical configuration, create a file call .cmake-args. E.g.:

There are three sets of variables present in this file:

  1. Build and install locations.

    • DIR:BUILD=... - Build directory
    • DIR:INSTALL=... - Install directory

    They may contain macros:

    • @PROJECT@ - name of current project (from CMakeList.txt)
    • @VERSION@ - project version number (from CMakeList.txt)
    • @BUILD@ - build type (from command line)
    • ${...} - environment variable
  2. ENV:VAR=... - Environment var set before running cmake

  3. VAR=... - Variable passed to cmake with -D prefix

Example:

$ cat > .cmake-args.${HOSTNAME}
DIR:BUILD=/tmp/@PROJECT@/build
DIR:INSTALL=/opt/pkt/@PROJECT@/@VERSION@
ENV:BOOST_ROOT=/opt/pkg/boost/current
ENV:BOOST_LIBRARYDIR=/opt/pkg/boost/current/gcc/lib
PKG_ROOT_DIR=/opt/pkg

Run:

$ make bootstrap [toolchain=gcc|clang]  [build=Debug|Release] \
                 [generator=make|ninja] [prefix=/usr/local] [verbose=true]
$ make [verbose=true]
$ make install      # Default install path is /usr/local

If you are doing a release install, the install process installs two versions of the library: libutxx_d.so (debug) and libutxx.so (release). To install release build you need to run the following steps:

$ make bootstrap toolchain=gcc build=debug
$ make src/libutxx_d.so src/libutxx_d.a     # build debug versions of the library
$ make rebootstrap build=release
$ make                                      # build release versions
$ make install

After running make bootstrap two local links are created build and inst pointing to build and installation directories.

If you need to do a full cleanup of the current build and rerun bootstrap with previously chosen options, do:

$ make distclean
$ make rebootstrap [toolchain=gcc|clang]  [build=Debug|Release]

Note that the rebootstrap command remembers previous bootstrap options, but if you give it arguments they will override the old ones.

Commit Notifications

The following news group was set up for commit notifications: github-utxx at googlegroups dot com

Contributing

Writing Commit Messages

Structure your commit message like this:

One line summary (less than 50 characters)

Longer description (wrap at 72 characters)

Summary

  • Less than 50 characters
  • What was changed
  • Imperative present tense (fix, add, change)
    • Fix bug 123
    • Add 'foobar' command
    • Change default timeout to 123
  • No period

Longer Description

  • Wrap at 72 characters
  • Why, explain intention and implementation approach
  • Present tense (fix, add, change)

Commit Atomicity

  • Break up logical changes
  • Make whitespace changes separately

Code Formatting

  • Wrap at 80 characters (not counting '\n')
  • Use 4-space indentation
  • Expand tabs with spaces in indentations (for vi use settings: ts=4:sw=4:et)
  • Place "// vim:ts=4:sw=4:et" at the beginning of each file
  • Use K&R braces style:
if (...) {
   ...
} else {
   ...
}
  • Name functions and classes using lower case letters with underscores (e.g. class my_class { int this_my_fun(); };)
  • Name function arguments by prefixing with "a_" (e.g. int my_fun(int a_count))
  • Name class member variables by prefixing with "m_" (e.g. class test { int m_count; };)
  • Name class static variables by prefixing with "s_" (e.g. class test { static const int s_ok = 1; };)

Author

  • Serge Aleynikov <saleyn at gmail dot com>
  • (see AUTHORS.md for a list of contributors)

LICENSE

  • Non-commercial: GNU Lesser General Public License 2.1
  • Commercial: (contact the author for details)

utxx's People

Contributors

saleyn avatar x0id avatar ltimochouk avatar altren avatar domarion avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.