Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
duneexamples
duneexamples
DuneExample
MyClass.cxx
Go to the documentation of this file.
1
// MyClass.cxx
2
3
#include "
MyClass.h
"
4
#include <iostream>
5
#include <string>
6
#include "TBuffer.h"
7
#include "TClass.h"
8
9
using
std::cout;
10
using
std::endl
;
11
using
std::string
;
12
13
MyClass::MyClass
() {
14
cout <<
"Creating object."
<<
endl
;
15
}
16
17
MyClass::~MyClass
() {
18
cout <<
"Deleting object."
<<
endl
;
19
delete
myobj
;
20
}
21
22
void
MyClass::Streamer
(TBuffer& buf) {
23
const
string
myname =
"MyClass: "
;
24
//TClass* pclass = MyClass::Class(); // With TObject?
25
TClass* pclass = TClass::GetClass(
"MyClass"
);
26
if
( buf.IsReading() ) {
27
if
( pclass ==
nullptr
) {
28
cout << myname <<
"Dictionary not found for read."
<<
endl
;
29
return
;
30
}
31
cout << myname <<
"Reading object."
<<
endl
;
32
pclass->ReadBuffer(buf,
this
);
33
++
readCount
;
34
}
else
{
35
if
( pclass ==
nullptr
) {
36
cout << myname <<
"Dictionary not found for write."
<<
endl
;
37
return
;
38
}
39
cout << myname <<
"Writing object."
<<
endl
;
40
pclass->WriteBuffer(buf,
this
);
41
}
42
}
MyClass::MyClass
MyClass()
Definition:
MyClass.cxx:13
MyClass.h
string
std::string string
Definition:
nybbler.cc:12
MyClass::~MyClass
~MyClass()
Definition:
MyClass.cxx:17
MyClass::readCount
unsigned int readCount
Definition:
MyClass.h:20
MyClass::Streamer
void Streamer(TBuffer &rbuf)
Definition:
MyClass.cxx:22
MyClass::myobj
TObject * myobj
Definition:
MyClass.h:19
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11