- Install protobufjs node module
$ npm install protobufjs
- Given a protobuf definition,
Person.proto
syntax = "proto2";
message Person {
| // --------------------------------------------------------------- // | |
| // Need To Know | |
| // _MSC_VER: Microsoft C/C++ Compiler | |
| // DLL_EXPORT: Defined when compiling to a DLL (DynamicLibrary) | |
| // STATIC_EXPORT: Defined when compiling to a LIB (StaticLibrary) | |
| // --------------------------------------------------------------- // | |
| // Microsoft C/C++ Compiler (MSVC) | |
| #if defined(_MSC_VER) | |
| #if defined(DLL_EXPORT) |
| // --------------------------------------------------------------- // | |
| // Need To Know | |
| // _MSC_VER: Microsoft C/C++ Compiler | |
| // --------------------------------------------------------------- // | |
| // Microsoft C/C++ Compiler | |
| #if defined (_MSC_VER) | |
| // Console Control | |
| #include <Windows.h> |
| // --------------------------------------------------------------- // | |
| // Need To Know | |
| // _MSC_VER: Microsoft C/C++ Compiler | |
| // __AVX2__: AVX2 Instruction Set Flag | |
| // __FMA__: Fused Multiply Add Flag | |
| // --------------------------------------------------------------- // | |
| // On Windows, __AVX2__ is defined but __FMA__ so define it | |
| #if defined(_MSC_VER) && defined(__AVX2__) && !defined(__FMA__) | |
| #define __FMA__ |
| <HTML> | |
| <HEAD> | |
| <LINK rel="stylesheet" href="awesomplete.css" /> | |
| </HEAD> | |
| <BODY> | |
| <!-- Awesomplete input box --> | |
| <INPUT id="awesomplete-input" /> | |
| <!-- Searchable item #1 --> |
| class Singleton { | |
| public: | |
| // Singleton Pattern | |
| // Instance() returns a single static instance of the Singleton class. | |
| // This singleton is shared between a single compilation unit. | |
| static Singleton& Instance() { | |
| static Singleton singleton; | |
| return singleton; | |
| } |
$ npm install protobufjs
Person.protosyntax = "proto2";
message Person {