• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

CppMicroServices/CppMicroServices: An OSGi-like C++ dynamic module system and se ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

CppMicroServices/CppMicroServices

开源软件地址:

https://github.com/CppMicroServices/CppMicroServices

开源编程语言:

C++ 92.6%

开源软件介绍:

Continuous Integration Status

Branch GCC 7.5.0 and 9.4.0 Visual Studio 2019  
Xcode 12.4 Visual Studio 2022  
Xcode 13.0 MinGW-w64  
Clang 9.0    
master BuildAndTestNix(master) BuildAndTestWindows(master) Code Coverage Status
development BuildAndTestNix BuildAndTestWindows Code Coverage Status (development)

Coverity Scan Build Status

C++ Micro Services

Documentation Status (stable) Documentation Status (development)

Download

Introduction

The C++ Micro Services project is a collection of components for building modular and dynamic service-oriented applications. It is based on OSGi, but tailored to support native cross-platform solutions.

Proper usage of C++ Micro Services patterns and concepts leads to systems with one or more of the following properties:

  • Re-use of software components
  • Loose coupling between service providers and consumers
  • Separation of concerns, based on a service-oriented design
  • Clean APIs based on service interfaces
  • Extensible and reconfigurable systems

Requirements

None, except a recent enough C++ compiler. All third-party library dependencies are included and mostly used for implementation details.

Supported Platforms

The library makes use of C++17 language and library features and compiles on many different platforms.

Recommended absolute minimum required compiler versions:

  • GCC 7.5.0
  • Clang 9.0
  • Clang from Xcode 10.0 (not tested)
  • Visual Studio 2017 (MSVC++ 15.0) (not tested)

Not all of the absolute minimum compiler versions are tested (as noted). We test and recommend the following compilers:

  • GCC 9.4.0
  • Clang 9.0
  • Clang from Xcode 12.0 and 13.0
  • Visual Studio 2019 and 2022

Recommended minimum required CMake version:

  • CMake 3.12.4

For all CI builds through GitHub Actions, the CMake version (and version of other provided software) we use is determined by the software provided on the GitHub-hosted runners.

For information about the specific versions of software the runners use, please see the following resources:

Below is a list of tested compiler/OS combinations:

  • GCC 7.5.0 (Ubuntu 18.04)
  • GCC 9.4.0 (Ubuntu 20.04)
  • Clang 9.0 (Ubuntu 18.04)
  • Apple Clang, Xcode 12.0.1 (OS X 10.15.7)
  • Apple Clang, Xcode 13.0.0 (OS X 11.0)
  • Visual Studio 2019
  • Visual Studio 2022
  • MinGW-w64

Legal

The C++ Micro Services project was initially developed at the German Cancer Research Center. Its source code is hosted as a GitHub Project. See the COPYRIGHT file in the top-level directory for detailed copyright information.

This project is licensed under the Apache License v2.0.

Code of Conduct

CppMicroServices.org welcomes developers with different backgrounds and a broad range of experience. A diverse and inclusive community will create more great ideas, provide more unique perspectives, and produce more outstanding code. Our aim is to make the CppMicroServices community welcoming to everyone.

To provide clarity of what is expected of our members, CppMicroServices has adopted the code of conduct defined by contributor-covenant.org. This document is used across many open source communities, and we believe it articulates our values well.

Please refer to the :any:`Code of Conduct <code-of-conduct>` for further details.

Quick Start

Start by cloning the project repository. It is important to note that since the project utilizes git submodules, you must clone the repository with the --recursive flag. This will also clone the submodules and place them in their respective directories. For further reading about how git submodules work and how to clone them into an already existing repository on your disk, please see Git's documentation.

Essentially, the C++ Micro Services library provides you with a powerful dynamic service registry on top of a managed lifecycle. The framework manages, among other things, logical units of modularity called bundles that are contained in shared or static libraries. Each bundle within a library has an associated :any:`cppmicroservices::BundleContext` 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 "cppmicroservices/BundleContext.h"
#include "SomeInterface.h"

using namespace cppmicroservices;

void UseService(BundleContext context)
{
  auto serviceRef = context.GetServiceReference<SomeInterface>();
  if (serviceRef)
  {
    auto service = context.GetService(serviceRef);
    if (service) { /* do something */ }
  }
}

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

#include "cppmicroservices/BundleContext.h"
#include "SomeInterface.h"

using namespace cppmicroservices;

void RegisterSomeService(BundleContext context, const std::shared_ptr<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++.

Git Branch Conventions

The Git repository contains two eternal branches, master and development. The master branch contains production quality code and its HEAD points to the latest released version. The development branch is the default branch and contains the current state of development. Pull requests by default target the development branch. See the :ref:`CONTRIBUTING <contributing>` file for details about the contribution process.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap