Menu

Tree [r3] /
 History

HTTPS access


File Date Author Commit
 example 2016-06-03 alpha2hz [r3] Version 0.5.0
 include 2016-06-03 alpha2hz [r3] Version 0.5.0
 src 2016-06-03 alpha2hz [r3] Version 0.5.0
 test 2016-06-03 alpha2hz [r3] Version 0.5.0
 Makefile 2016-06-03 alpha2hz [r3] Version 0.5.0
 README.txt 2016-06-03 alpha2hz [r3] Version 0.5.0

Read Me

-----------------------------------------------------------------------------
HPL -- High Performance Linux -- ver 0.5.0 -- 01 Jun 2016
Written by: Dan Moldenhauer
-----------------------------------------------------------------------------
The MIT License (MIT)

Copyright (c) 2016 Dan Moldenhauer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------

The entirety of this project has been built and tested on only:
 a) 64-bit Gentoo Linux.

Some components of this project have been successfully used on:
 a) 32-bit Gentoo Linux.
 b) Raspberry Pi (ARM 32-bit Raspbian 'Wheezy')

There has been no testing or other verification whatsoever on any other
platform.

-----------------------------------------------------------------------------
OVERVIEW

This library currently contains the following abstractions:

ArgParser.h        -- Command-line parser (flag/option parsing)
                       + HPL::ArgParser

AsyncFileWriter.h  -- Binary/text asynchronous file output
                       + HPL::AsyncBinaryFileWriter
                       + HPL::AsyncTextFileWriter

Base64.h           -- Base64 encoding/decoding (per RFC2045/MIME)
                       + HPL::Base64

BinaryFile.h       -- Binary file I/O (generic binary I/O)
                       + HPL::BinaryFileReader
                       + HPL::BinaryFileWriter

CfgParser.h        -- Config file parser
                       + HPL::CfgParser

Clock.h            -- System clock tools (get/format time)
                       + HPL::Clock

Console.h          -- Linux console tools (color/format text)
                       + HPL::Console

DateTime.h         -- Date (and time) tools including parsing
                       + HPL::DateTime

Exception.h        -- Basic C++ exception (used inside HPL)
                       + HPL::Exception

FileInfo.h         -- Basic file information (file size, etc)
                       + HPL::FileInfo

FileSystem.h       -- Basic file system commands (move, mkdir, etc)
                       + HPL::FileSystem

HTTPServer.h       -- Basic threaded HTTP server (partial HTTP/1.1 support)
                       + HPL::HTTPServer

Interconnect.h     -- Message passing abstraction (TCP, UDP, queue, etc)
                       + HPL::Interconnect

InterProcess*.h    -- Inter-process message queues (using /dev/shm)
                       + HPL::InterProcessQueue (one channel)
                       + HPL::InterProcessMultiQueue (multiple channels)

Interruptable.h    -- Program interruption (Ctrl+C from console, etc)
                       + HPL::Interruptable

Logger.h           -- Console and file logger (with color console support)
                       + HPL::Logger

MemoryPool.h       -- Thread-safe pre-allocation containers (retains element ownership)
                       + HPL::MemoryPoolOnHeap (fixed/variable size)
                       + HPL::MemoryPoolOnStack (fixed size)

MMAPFile.h         -- Memory-mapped file abstraction (read/write)
                       + HPL::MMAPFile

Multiplex*.h       -- Abstraction for passing multiple discrete message types
                       + HPL::MultiplexInterconnect (basic Interconnect with multiplexing)
                       + HPL::MultiplexPubSub (asynchronous command-response abstraction)

MultiSocket.h      -- Multiple sockets (epoll wrapper)
                       + HPL::MultiSocket

Mutex.h            -- Multi-thread locking wrappers
                       + HPL::Mutex  (pthread mutex)
                       + HPL::SpinMutex  (asm spinlock)
                       + HPL::ScopedMutex  (locking by scope)
                       + HPL::AtomicCounter  (thread-safe counter)

NamedObjectStore.h -- Allocation container with human-readable name lookup
                       + HPL::NamedObjectStore

NamedQueue.h       -- Similar to combination of NamedObjectStore and Queue
                       + HPL::NamedQueue

ObjectPool.h       -- Thread-safe allocation container (relinquishies element ownership)
                       + HPL::ObjectPool (FIFO tracking)

Queue.h            -- Fixed-length data queue
                       + HPL::Queue

Semaphore.h        -- Linux semaphore wrapper
                       + HPL::Semaphore

SerialPort.h       -- Linux TTY I/O wrapper
                       + HPL::SerialPort

SharedMemory.h     -- Abstraction of MMAP'ed '/dev/shm/' data
                       + HPL::SharedMemory

Signal.h           -- POSIX condition variable wrapper
                       + HPL::Signal

Socket.h           -- Socket abstraction (TCP, UDP, Multicast)
                       + HPL::Socket

StreamCompressor.h -- Fixed-length data compression/decompression
                       + HPL::StreamCompressor
                       + HPL::StreamExpander

String.h           -- String manipulation (tokenize, case)
                       + HPL::String

Subscriber.h       -- Asynchronous message receiver (or command/response server)
                       + HPL::Subscriber

TCPServer.h        -- Threaded TCP server
                       + HPL::TCPServer

TextFile.h         -- Text file I/O (generic text I/O)
                       + HPL::TextFileReader
                       + HPL::TextFileWriter

Thread.h           -- Linux pthread wrapper
                       + HPL::Thread

Timer.h            -- Asynchronous one-shot/periodic executor 
                       + HPL::Timer

UnitTest.h         -- Abstraction to select, execute, and summarize testing
                       + HPL::UnitTest

-----------------------------------------------------------------------------
USAGE

1) Build the library (currently, it's a static library):
   a) enter the hpl/ or hpl/src/ directory
   b) execute: 'make release' or 'make debug' (depending on your desires)

2) Include files in the hpl/include/ directory in your project.
   a) #include "hpl/include/<file>.h"
   b) g++ .... -I <hpl path>/include/ ...

3) Link against the HPL library when you build your project:
   a) g++ .... -L <hpl path>/src/ ... -lhpl ...
   b) note: you may also need to link against -lpthread, -lrt, -lz, -lm
        depending on what you're using from HPL

-----------------------------------------------------------------------------
TESTS

The HPL library comes with a substantial suite of unit tests. To test:
  a) enter the hpl/ directory
  b) execute: 'make tests'
  c) enter the hpl/test/ directory
  d) execute: './test'
  e) note: if you care to run only [a] certain test[s]:
       execute './test <name> [<name> ...]', i.e: './test Logger Socket'

-----------------------------------------------------------------------------
EXAMPLES
The HPL library comes with a number of example programs. To run them:
  a) enter the hpl/ directory
  b) execute: 'make examples'
  c) enter the hpl/example/ directory
  d) execute the example program of your choice

-----------------------------------------------------------------------------