This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
programming:cpp:binary [2022/04/11 13:04] odagawa |
programming:cpp:binary [2022/04/30 17:48] (current) odagawa |
||
---|---|---|---|
Line 5: | Line 5: | ||
ROOT を使っている限りは気にする必要がないが, emulsion とのデータをやり取りするために必要だった. | ROOT を使っている限りは気にする必要がないが, emulsion とのデータをやり取りするために必要だった. | ||
- | たとえば以下のようなクラスをかんがえる. | + | このとき,vector |
+ | したがって,'' | ||
+ | 単なるメンバ変数とともに vector の要素数を追加で読み書きできるようにしておくことがポイントだと思う. | ||
- | <code cpp> | + | たとえば以下のようなクラスを考える. |
- | class Myclass | + | |
+ | <code cpp MyClass.hpp> | ||
+ | #ifndef MYCLASS_HPP | ||
+ | #define MYCLASS_HPP | ||
+ | |||
+ | #include < | ||
+ | |||
+ | class MyClass | ||
public : | public : | ||
int var1; | int var1; | ||
Line 14: | Line 23: | ||
std:: | std:: | ||
}; | }; | ||
+ | #endif | ||
</ | </ | ||
読み取りは以下のように行う. | 読み取りは以下のように行う. | ||
- | <code cpp> | + | < |
#include < | #include < | ||
#include < | #include < | ||
Line 61: | Line 71: | ||
書き込みは以下のように行う. | 書き込みは以下のように行う. | ||
- | <code cpp> | + | < |
#include < | #include < | ||
#include < | #include < |