22 |
#include "FamilyRecord.hh" |
#include "FamilyRecord.hh" |
23 |
#include "patterns/SmartPtr.hh" |
#include "patterns/SmartPtr.hh" |
24 |
#include "GEDCOMParser/Visitor/GEDCOMVisitor.hh" |
#include "GEDCOMParser/Visitor/GEDCOMVisitor.hh" |
25 |
|
#include "GEDCOMParser/GEDCOMFactory.hh" |
26 |
|
#include "GEDCOMParser/GEDCOMFactoryAccessor.hh" |
27 |
|
|
28 |
|
|
29 |
GEDCOMParser::FamilyRecord::FamilyRecord(std::string const &id = "") |
GEDCOMParser::FamilyRecord::FamilyRecord(std::string const &id = "") |
41 |
return; |
return; |
42 |
} |
} |
43 |
|
|
44 |
void GEDCOMParser::FamilyRecord::addFamilyEvent(GEDCOMParser::FamilyEvent * const e) |
GEDCOMParser::FamilyEvent * GEDCOMParser::FamilyRecord::addFamilyEvent(GEDCOMParser::FamilyEvent * const data = 0) |
45 |
{ |
{ |
46 |
_events.push_back(SmartPtr<FamilyEvent>(e)); |
GEDCOMParser::FamilyEvent * tmp_data = data; |
47 |
return; |
if (data == 0) |
48 |
|
{ |
49 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
50 |
|
GEDCOMParser::FamilyEvent * tmp_data = factory->createFamilyEvent(); |
51 |
|
} |
52 |
|
_events.push_back(SmartPtr<FamilyEvent>(tmp_data)); |
53 |
|
return _events.back().getPtr(); |
54 |
} |
} |
55 |
|
|
56 |
void GEDCOMParser::FamilyRecord::setHusb(std::string const & value) |
void GEDCOMParser::FamilyRecord::setHusb(std::string const & value) |
83 |
return; |
return; |
84 |
} |
} |
85 |
|
|
86 |
void GEDCOMParser::FamilyRecord::addLdsSpouseSealing(GEDCOMParser::LdsSpouseSealing * const lds_spouse_sealing) |
GEDCOMParser::LdsSpouseSealing * GEDCOMParser::FamilyRecord::addLdsSpouseSealing(GEDCOMParser::LdsSpouseSealing * const data = 0) |
87 |
{ |
{ |
88 |
_lds_spouse_sealings.push_back(SmartPtr<LdsSpouseSealing>(lds_spouse_sealing)); |
GEDCOMParser::LdsSpouseSealing * tmp_data = data; |
89 |
return; |
if (data == 0) |
90 |
|
{ |
91 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
92 |
|
GEDCOMParser::LdsSpouseSealing * tmp_data = factory->createLdsSpouseSealing(); |
93 |
|
} |
94 |
|
_lds_spouse_sealings.push_back(SmartPtr<LdsSpouseSealing>(tmp_data)); |
95 |
|
return _lds_spouse_sealings.back().getPtr(); |
96 |
} |
} |
97 |
|
|
98 |
void GEDCOMParser::FamilyRecord::addSourceCitation(GEDCOMParser::SourceCitation * const src_citation) |
GEDCOMParser::SourceCitation * GEDCOMParser::FamilyRecord::addSourceCitation(GEDCOMParser::SourceCitation * const data = 0) |
99 |
{ |
{ |
100 |
_citations.push_back(SmartPtr<SourceCitation>(src_citation)); |
GEDCOMParser::SourceCitation * tmp_data = data; |
101 |
return; |
if (data == 0) |
102 |
|
{ |
103 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
104 |
|
GEDCOMParser::SourceCitation * tmp_data = factory->createSourceCitation(); |
105 |
|
} |
106 |
|
_citations.push_back(SmartPtr<SourceCitation>(tmp_data)); |
107 |
|
return _citations.back().getPtr(); |
108 |
} |
} |
109 |
|
|
110 |
void GEDCOMParser::FamilyRecord::addMultimediaLink(GEDCOMParser::MultimediaLink * const mm_link) |
GEDCOMParser::MultimediaLink * GEDCOMParser::FamilyRecord::addMultimediaLink(GEDCOMParser::MultimediaLink * const data = 0) |
111 |
{ |
{ |
112 |
_mm_links.push_back(SmartPtr<MultimediaLink>(mm_link)); |
GEDCOMParser::MultimediaLink * tmp_data = data; |
113 |
return; |
if (data == 0) |
114 |
|
{ |
115 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
116 |
|
GEDCOMParser::MultimediaLink * tmp_data = factory->createMultimediaLink(); |
117 |
|
} |
118 |
|
_mm_links.push_back(SmartPtr<MultimediaLink>(tmp_data)); |
119 |
|
return _mm_links.back().getPtr(); |
120 |
} |
} |
121 |
|
|
122 |
void GEDCOMParser::FamilyRecord::addNoteStructure(GEDCOMParser::NoteStructure * const note_struct) |
GEDCOMParser::NoteStructure * GEDCOMParser::FamilyRecord::addNoteStructure(GEDCOMParser::NoteStructure * const data = 0) |
123 |
{ |
{ |
124 |
_notes.push_back(SmartPtr<NoteStructure>(note_struct)); |
GEDCOMParser::NoteStructure * tmp_data = data; |
125 |
return; |
if (data == 0) |
126 |
|
{ |
127 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
128 |
|
GEDCOMParser::NoteStructure * tmp_data = factory->createNoteStructure(); |
129 |
|
} |
130 |
|
_notes.push_back(SmartPtr<NoteStructure>(tmp_data)); |
131 |
|
return _notes.back().getPtr(); |
132 |
} |
} |
133 |
|
|
134 |
void GEDCOMParser::FamilyRecord::addUserReference(GEDCOMParser::UserReference * const user_ref) |
GEDCOMParser::UserReference * GEDCOMParser::FamilyRecord::addUserReference(GEDCOMParser::UserReference * const data = 0) |
135 |
{ |
{ |
136 |
_user_references.push_back(SmartPtr<UserReference>(user_ref)); |
GEDCOMParser::UserReference * tmp_data = data; |
137 |
return; |
if (data == 0) |
138 |
|
{ |
139 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
140 |
|
GEDCOMParser::UserReference * tmp_data = factory->createUserReference(); |
141 |
|
} |
142 |
|
_user_references.push_back(SmartPtr<UserReference>(tmp_data)); |
143 |
|
return _user_references.back().getPtr(); |
144 |
} |
} |
145 |
|
|
146 |
void GEDCOMParser::FamilyRecord::setRin(std::string const & value) |
void GEDCOMParser::FamilyRecord::setRin(std::string const & value) |
149 |
return; |
return; |
150 |
} |
} |
151 |
|
|
152 |
void GEDCOMParser::FamilyRecord::setChangeDate(GEDCOMParser::ChangeDate * const chg_date) |
GEDCOMParser::ChangeDate * GEDCOMParser::FamilyRecord::setChangeDate(GEDCOMParser::ChangeDate * const data = 0) |
153 |
{ |
{ |
154 |
_change_date = SmartPtr<ChangeDate>(chg_date); |
GEDCOMParser::ChangeDate * tmp_data = data; |
155 |
return; |
if (data == 0) |
156 |
|
{ |
157 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
158 |
|
GEDCOMParser::ChangeDate * tmp_data = factory->createChangeDate(); |
159 |
|
} |
160 |
|
_change_date = SmartPtr<ChangeDate>(tmp_data); |
161 |
|
return _change_date.getPtr(); |
162 |
} |
} |
163 |
|
|
164 |
GEDCOMParser::FamilyRecord::~FamilyRecord(void) |
GEDCOMParser::FamilyRecord::~FamilyRecord(void) |