RInside Version 0.2.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
foo.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * These are just two example classes that will be communicated between program and rserver.
4  *
5  * See common/binarystream.h/.cpp for information about serialization,
6  * see foo_rcpp_wrapper_*.h for code that converts these objects into R objects and back.
7  */
8 
9 #include "common/binarystream.h"
10 #include <string>
11 #include <cstdint>
12 
13 
14 /*
15  * Foo just contains a name and two numbers.
16  */
17 class Foo {
18  public:
19  Foo(const std::string &name, int32_t a, int32_t b);
20  ~Foo();
21 
22  std::string name;
23  int32_t a, b;
24 
25  // These three are for IPC
26  static const int32_t TYPEID = 1;
27  void serialize(BinaryStream &stream) const;
28  static Foo deserialize(BinaryStream &stream);
29 };
static const int32_t TYPEID
Definition: foo.h:26
Definition: foo.h:17
std::string name
Definition: foo.h:22
Foo(const std::string &name, int32_t a, int32_t b)
Definition: foo.cpp:4
int32_t a
Definition: foo.h:23
int32_t b
Definition: foo.h:23
void serialize(BinaryStream &stream) const
Definition: foo.cpp:12
~Foo()
Definition: foo.cpp:8
static Foo deserialize(BinaryStream &stream)
Definition: foo.cpp:19