Coder Social home page Coder Social logo

cppmicroservices's Introduction

Build Status

Coverity Scan Build Status

C++ Micro Services version 2.99.0

Introduction

The C++ Micro Services library provides a dynamic service registry and module system, partially based the OSGi Core Release 5 specifications. It enables developers to create a service oriented and dynamic software stack.

Proper usage of the C++ Micro Services library leads to

  • Re-use of software components
  • Loose coupling
  • Separation of concerns
  • Clean APIs based on service interfaces
  • Extensible systems

and more.

Requirements

This is a pure C++ implementation of the OSGi service model and does not have any third-party library dependencies.

Supported Platforms

The library should compile on many different platforms. Below is a list of tested compiler/OS combinations:

  • GCC 4.6 (Ubuntu 12.04)
  • GCC 4.8 (Ubuntu 13.10)
  • Clang 3.2 (Ubuntu 13.10)
  • Clang (MacOS X 10.8 and 10.9)
  • Visual Studio 2008 SP1, 2010, 2012, 2013 (Windows 7)

Legal

Copyright (c) German Cancer Research Center (DKFZ). Licensed under the Apache License v2.0.

Quick Start

Essentially, the C++ Micro Services library provides you with a powerful dynamic service registry. Each shared or static library has an associated ModuleContext object, through which the service registry is accessed.

To query the registry for a service object implementing one or more specific interfaces, the code would look like this:

#include <usModuleContext.h>
#include <someInterface.h>

using namespace us;

void UseService(ModuleContext* context)
{
  ServiceReference serviceRef = context->GetServiceReference<SomeInterface>();
  if (serviceRef)
  {
    SomeInterface* service = context->GetService<SomeInterface>(serviceRef);
    if (service) { /* do something */ }
  }
}

Registering a service object against a certain interface looks like this:

#include <usModuleContext.h>
#include <someInterface.h>

using namespace us;

void RegisterSomeService(ModuleContext* context, SomeInterface* service)
{
  context->RegisterService<SomeInterface>(service);
}

The OSGi service model additionally allows to annotate services with properties and using these properties during service look-ups. It also allows to track the life-cycle of service objects. Please see the Documentation for more examples and tutorials and the API reference. There is also a blog post about OSGi Lite for C++.

Build Instructions

Please visit the Build Instructions page online.

cppmicroservices's People

Contributors

al-sabr avatar

Watchers

 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.