A Gerrit repository contains formatter configuration profiles compatible with Eclipse and Visual Studio. Refer to the attached README to know how to use them.
An Eclipse configuration file is available in the Quimesis Drive ( 06 Documentation > Doc info > quimesis_coding_rules_for_eclipse.xml
); refer to the Development environment
document in the same directory for how to use it.
MyUnit_init();
#ifndef MY_CLASS_HPP__ #define MY_CLASS_HPP__ class MyClass { public: MyClass(); ~MyClass(); void do(); }; #endif
#include "MyClass.hpp" MyClass::MyClass() { } MyClass::~MyClass() { } void MyClass::do() { // do something }
Protect your C headers for C++ inclusions:
#ifndef MY_HEADER_H__ #define MY_HEADER_H__ #ifdef __cplusplus extern "C" { #endif void unit_myFunction(void); #ifdef __cplusplus } #endif #endif
if ( a == b ) { // do something }
Do not overuse abbreviations and acronyms to keep the code clear. However for common and well known names, use below table.
Abbreviation | Meaning |
---|---|
cbf | Callback Function |
ptr | Pointer |
Here is a list of well known libraries that provide various kinds of functionalities. Whenever you need one of them, prefer to use the below library so that we keep a uniform code-base.
ZeroMQ, and its multiple bindings like py-zmq, is a transport layer for inter-process, inter-tasks, inter-node communications. It supports various paradigms of communications ( requests-response, push-pull, publish-subscribe, etc) and handles most of the network complexity (like reconnections, data integrity, etc).
Whenever possible use python3 instead of python2.
When writing Python code, make sure it is python3 compatible.
https://code.google.com/p/googletest/
Google Test is a test framework for C/C++. It is the recommended way to write Unit Tests for C++ code.
When developing graphical applications, prefer Qt or one of its bindings (like PyQt).
A standard-compliant UPnP library to build devices and control points.
Ubuntu package to install: libmosquitto-dev
https://github.com/open-source-parsers/jsoncpp
Ubuntu package to install: libjsoncpp-dev
http://libserial.sourceforge.net/
Ubuntu package to install: libserial-dev
switch(<var>) { case <value>: { <code> break; } }