No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images
moxygen
LICENSE.md
README.md

README.md

Technical Spec

What is Klepsydra

  • Middleware dependency injection framework
  • Very simple asynchronous API
  • Test Driven Development friendly
  • High performance toolset
  • REST and Node plugins

Klepsydra design is inspired in several well established software engineering products and best practices:

How does it work

Completely transparent middleware injection by means of using the core API, Klepsydra hides completely the underlying middleware from the application.

  • Very small footprint
  • Light dependencies
  • Minimal overhead

Application API

Klepsydra offers a very simple asynchronous core API consisting of the following three interfaces (pure C++11):

Publisher

template <class T>
class Publisher
{
public:
	virtual void publish(const T& event) = 0;
};

Subscriber

template <class T>
class Subscriber
{
   public:
      virtual void registerListener(const std::string name, 
                                    const std::function<void(T)> listener) = 0;
};

Service

class Service
{
public:
  virtual void execute() = 0;
}

Dependency Injection (Composition API)

  • Middleware dependency injection happens exactly in the same way it is done for integration tests.
  • Using composition-root pattern (like Spring) in a composition class, different middleware can be injected to the services without having to change the business logic code one bit.
  • Different setups can be available for different environments, e.g., simulation and real stages, etc.

Dependency Injection Example: Simulation and Production Stages

Klepsydra can handle different stages. E.g. simulation and production stages.

Current Features

Installation Instructions

Prerequisites

sudo apt install build-essentials
sudo apt install git
sudo apt install cmake
git clone https://github.com/google/googletest.git googletest-master

Google-Tests has to be at the level of the part of the folder where Klepsydra core will be installed. For example, if Klepsydra is installed in: $KLEPSYDRA_HOME/kpsr-core

Then google tests has to be installed in: ~/googletest-master

This location can be overridden by including the variable

GTEST_PATH

In the kpsr-core cmake invokation.

Clone and install YAML-CPP:

git clone https://github.com/jbeder/yaml-cpp
cd yaml-cpp
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON ..
make
sudo make install

Installation

mkdir $KLEPSYDRA_HOME
cd $KLEPSYDRA_HOME
git clone https://bitbucket.org/kpsr-devs/kpsr-core.git
cd kpsr-core
mkdir build
cd build
cmake ..
make
make test
sudo make install

This will install the klespydra core in

/opt/klepsydra	

The cmake has the following options:

  • -DKPSR_WITH_DDS=true for building the DDS binding
  • -DKPSR_WITH_ZMQ=true for building the ZeroMQ binding.
  • -DKPSR_TEST_PERFORMANCE=true for building the performance tests

Documentation generation

make doc
moxygen --templates $KLEPSYDRA_HOME/kpsr-core-doc/moxygen/templates --groups --output api-%s.md ./xml

API Documentation

The API is very well documented with examples and tutorials. It is divded into two main areas. Application development, including testing and application monitoring:

And the wiring or composition of the applications:

License

© Copyright 2016-2017, Klepsydra Robotics, all rights reserved. Licensed under the terms in LICENSE.md

This software and documentation are Copyright 2016 to 2017 Klepsydra Robotics Limited and its licensees. All rights reserved. See license file for full copyright notice and license terms.