-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRelation.cpp
48 lines (36 loc) · 821 Bytes
/
Relation.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "Relation.h"
Relation::Relation(Relation* relation)
:LView(relation),
fArite(relation->fArite)
{}
Relation::Relation(BString* relation, int arite)
:LView(*relation << "_r^" << arite),
fArite(arite)
{}
Relation::Relation(BMessage* archive)
:LView(archive)
{
archive->FindInt32("fArite", (int32*)&fArite);
}
int Relation::GetArite()
{
return fArite;
}
void Relation::PrintToStream()
{
LView::PrintToStream();
}
status_t Relation::Archive(BMessage* archive, bool deep)
{
status_t status;
status = LView::Archive(archive, deep);
if (status < B_OK) return status;
status = archive->AddInt32("fArite", fArite);
return status;
}
BArchivable* Relation::Instantiate(BMessage* archive) {
if (!validate_instantiation(archive, "Relation")) {
return NULL;
}
return new Relation(archive);
}