Giter Site home page Giter Site logo

carloslema / libqi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aldebaran/libqi

0.0 1.0 0.0 10.52 MB

NAOqi core framework

Home Page: http://doc.aldebaran.com/libqi/

License: BSD 3-Clause "New" or "Revised" License

CMake 1.11% C++ 98.84% C 0.05%

libqi's Introduction

libqi

libqi is a middle-ware framework that provides RPC, type-erasure, cross-language interoperability, OS abstractions, logging facilities, asynchronous task management, dynamic module loading.

Compilation

To compile libqi you need qibuild which give some cmake functions used in libqi's CMakeLists.txt.

pip2 install --user qibuild

git clone [email protected]:aldebaran/libqi.git
cd libqi

mkdir BUILD && cd BUILD
cmake .. -DQI_WITH_TESTS=OFF
make
make install DESTDIR=./output

Example

The following example shows some features of the framework, please refer to the documentation for further details.

#include <boost/make_shared.hpp>
#include <qi/log.hpp>
#include <qi/applicationsession.hpp>
#include <qi/anyobject.hpp>

qiLogCategory("myapplication");

class MyService
{
public:
  void myFunction(int val) {
    qiLogInfo() << "myFunction called with " << val;
  }
  qi::Signal<int> eventTriggered;
  qi::Property<float> angle;
};

// register the service to the type-system
QI_REGISTER_OBJECT(MyService, myFunction, eventTriggered, angle);

void print()
{
  qiLogInfo() << "print was called";
}

int main(int argc, char* argv[])
{
  qi::ApplicationSession app(argc, argv);

  // connect the session included in the app
  app.start();

  qi::SessionPtr session = app.session();

  // register our service
  session->registerService("MyService", boost::make_shared<MyService>());

  // get our service through the middleware
  qi::AnyObject obj = session->service("MyService");

  // call myFunction
  obj.call<void>("myFunction", 42);

  // call print in 2 seconds
  qi::async(&print, qi::Seconds(2));

  // block until ctrl-c
  app.run();
}

You can then run the program with:

./myservice --qi-standalone # for a standalone server
./myservice --qi-url tcp://somemachine:9559 # to connect to another galaxy of sessions

Links

git repository: http://github.com/aldebaran/libqi

Documentation: http://doc.aldebaran.com/libqi/

IRC Channel: #qi on freenode.

Maintainers:

libqi's People

Contributors

cgestes avatar ckilner avatar hcuche avatar blastrock avatar dmerejkowsky avatar klaim avatar goreal avatar jlanca avatar llec avatar rom1v avatar gschweitzer-aldebaran avatar lpea avatar clemolgat-sbr avatar houssemkouki avatar jmassot avatar alkino avatar rhumbert avatar

Watchers

Carlos Lema 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.