General-purpose C++ utility classes used in other projects within the Ubiquitous Internet research group at IIT-CNR (uiiit).
First, make sure you have CMake (version >= 3.2), a recent C++ compiler and all the dependencies installed:
Very likely you can find packaged versions of the first two (glog and Boost) in your system's package repository. Make sure you are installing the development version of the packages, which also include header files. gRPC is better built from source, and it may automatically download and compile protobuf too (recommended).
Note that gmock is also needed to compile the unit tests but, if everything goes right, it will be downloaded automatically by CMake (needless to say: you do need a working Internet connection for this step).
git clone git@github.com:ccicconetti/support.git
cd support
Once everything is ready (assuming clang++
is your compiler):
cd build/debug
../build.sh clang++
make
This will compile the full build tree consisting of:
RpcSupport
: library with simple wrappers of gRPC client/server- `Support: generic support library
Test
: unit tests, which you can execute withTest/testsupport
If you want to compile with compiler optimisations and no assertions:
cd build/release
../build.sh clang++
make
The unit tests will not be compiled (gmock will not be even downloaded).
At least two ways:
-
[recommended] Include the full git source tree in your project as a submodule (e.g., under
support
), addadd_subdirectory(support/Support)
andadd_subdirectory(support/RpcSupport)
directives to yourCMakeLists.txt
file, fix the header inclusion path so that is also searches in there, and finally in all your targets that use the library adduiiitsupport
anduiiitrpcsupport
-
Copy the header files in your header inclusion path, copy the compiled libraries in your library inclusion path.
Method 1 is preferrable because: the dependency stays together with your code; if improvements/fixes are made to the library you just have to update the submodule.
SimpleServer
,SimpleStreamingServer
: gRPC server wrapper classesSimpleClient
: gRPC client wrapper class
Chrono
: chronometerCliOptions
: wrapper ofboost::program_options
Conf
: key/value parserGlogRaii
: clear start-up/tear-down of the glog sub-systemHistogram
: binned histogramLinearEstimation
: linear regressionMmTable
: formats string as a Mattermost tableMovingAvg
,MovingVariance
: average, variance over a moving windowPeriodicTask
: execute a task periodically in a dedicated threadProcess
: query the user/system load of the current processQueue
: blocking thread-safe queueRandom
: wrapper of somestd::random
r.v.'sSignalHandlerFlag
,SignalHandlerWait
: captures SIGINT and sets a flag when received or waits until receivedStat
: wrapper ofboost::accumulators
System
: basic system informationThreadPool
: pool of thread doing somethingThrower
: wrapper to check/format C++ exceptionsUuid
: wrapper ofboost::uuids::uiiid