| 22 |
#include "IndividualRecord.hh" |
#include "IndividualRecord.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 |
GEDCOMParser::IndividualRecord::IndividualRecord(std::string const &id = "") |
GEDCOMParser::IndividualRecord::IndividualRecord(std::string const &id = "") |
| 29 |
{ |
{ |
| 46 |
return; |
return; |
| 47 |
} |
} |
| 48 |
|
|
| 49 |
GEDCOMParser::PersonalName * GEDCOMParser::IndividualRecord::addPersonalName(PersonalName * const name = 0) |
GEDCOMParser::PersonalName * GEDCOMParser::IndividualRecord::addPersonalName(PersonalName * const data = 0) |
| 50 |
{ |
{ |
| 51 |
if (name != 0) |
GEDCOMParser::PersonalName * tmp_data = data; |
| 52 |
|
if (data == 0) |
| 53 |
{ |
{ |
| 54 |
_personal_names.push_back(SmartPtr<PersonalName>(name)); |
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 55 |
} |
GEDCOMParser::PersonalName * tmp_data = factory->createPersonalName(); |
|
else |
|
|
{ |
|
|
_personal_names.push_back(SmartPtr<PersonalName>(new PersonalName)); |
|
| 56 |
} |
} |
| 57 |
|
_personal_names.push_back(SmartPtr<PersonalName>(tmp_data)); |
| 58 |
return _personal_names.back().getPtr(); |
return _personal_names.back().getPtr(); |
| 59 |
} |
} |
| 60 |
|
|
| 90 |
return _individual_attributes.back().getPtr(); |
return _individual_attributes.back().getPtr(); |
| 91 |
} |
} |
| 92 |
|
|
| 93 |
void GEDCOMParser::IndividualRecord::addLdsIndividualOrdinance(GEDCOMParser::LdsIndividualOrdinance * const lio) |
GEDCOMParser::LdsIndividualOrdinance * GEDCOMParser::IndividualRecord::addLdsIndividualOrdinance(GEDCOMParser::LdsIndividualOrdinance * const data = 0) |
| 94 |
{ |
{ |
| 95 |
_lds_individual_ordinances.push_back(SmartPtr<LdsIndividualOrdinance>(lio)); |
GEDCOMParser::LdsIndividualOrdinance * tmp_data = data; |
| 96 |
return; |
if (data == 0) |
| 97 |
|
{ |
| 98 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 99 |
|
GEDCOMParser::LdsIndividualOrdinance * tmp_data = factory->createLdsIndividualOrdinance(); |
| 100 |
|
} |
| 101 |
|
_lds_individual_ordinances.push_back(SmartPtr<LdsIndividualOrdinance>(tmp_data)); |
| 102 |
|
return _lds_individual_ordinances.back().getPtr(); |
| 103 |
} |
} |
| 104 |
|
|
| 105 |
void GEDCOMParser::IndividualRecord::addChildToFamilyLink(GEDCOMParser::ChildToFamilyLink * const child) |
GEDCOMParser::ChildToFamilyLink * GEDCOMParser::IndividualRecord::addChildToFamilyLink(GEDCOMParser::ChildToFamilyLink * const data = 0) |
| 106 |
{ |
{ |
| 107 |
_child_to_family_links.push_back(SmartPtr<ChildToFamilyLink>(child)); |
GEDCOMParser::ChildToFamilyLink * tmp_data = data; |
| 108 |
return; |
if (data == 0) |
| 109 |
|
{ |
| 110 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 111 |
|
GEDCOMParser::ChildToFamilyLink * tmp_data = factory->createChildToFamilyLink(); |
| 112 |
|
} |
| 113 |
|
_child_to_family_links.push_back(SmartPtr<ChildToFamilyLink>(tmp_data)); |
| 114 |
|
return _child_to_family_links.back().getPtr(); |
| 115 |
} |
} |
| 116 |
|
|
| 117 |
void GEDCOMParser::IndividualRecord::addSpouseToFamilyLink(GEDCOMParser::SpouseToFamilyLink * const spouse) |
GEDCOMParser::SpouseToFamilyLink * GEDCOMParser::IndividualRecord::addSpouseToFamilyLink(GEDCOMParser::SpouseToFamilyLink * const data = 0) |
| 118 |
{ |
{ |
| 119 |
_spouse_to_family_links.push_back(SmartPtr<SpouseToFamilyLink>(spouse)); |
GEDCOMParser::SpouseToFamilyLink * tmp_data = data; |
| 120 |
return; |
if (data == 0) |
| 121 |
|
{ |
| 122 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 123 |
|
GEDCOMParser::SpouseToFamilyLink * tmp_data = factory->createSpouseToFamilyLink(); |
| 124 |
|
} |
| 125 |
|
_spouse_to_family_links.push_back(SmartPtr<SpouseToFamilyLink>(tmp_data)); |
| 126 |
|
return _spouse_to_family_links.back().getPtr(); |
| 127 |
} |
} |
| 128 |
|
|
| 129 |
void GEDCOMParser::IndividualRecord::addSubmXref(std::string const & value) |
void GEDCOMParser::IndividualRecord::addSubmXref(std::string const & value) |
| 132 |
return; |
return; |
| 133 |
} |
} |
| 134 |
|
|
| 135 |
void GEDCOMParser::IndividualRecord::addAssociation(GEDCOMParser::Association * const assoc) |
GEDCOMParser::Association * GEDCOMParser::IndividualRecord::addAssociation(GEDCOMParser::Association * const data = 0) |
| 136 |
{ |
{ |
| 137 |
_associations.push_back(SmartPtr<Association>(assoc)); |
|
| 138 |
return; |
GEDCOMParser::Association * tmp_data = data; |
| 139 |
|
if (data == 0) |
| 140 |
|
{ |
| 141 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 142 |
|
GEDCOMParser::Association * tmp_data = factory->createAssociation(); |
| 143 |
|
} |
| 144 |
|
_associations.push_back(SmartPtr<Association>(tmp_data)); |
| 145 |
|
return _associations.back().getPtr(); |
| 146 |
} |
} |
| 147 |
|
|
| 148 |
void GEDCOMParser::IndividualRecord::addAliaXref(std::string const & value) |
void GEDCOMParser::IndividualRecord::addAliaXref(std::string const & value) |
| 163 |
return; |
return; |
| 164 |
} |
} |
| 165 |
|
|
| 166 |
void GEDCOMParser::IndividualRecord::addSourceCitation(GEDCOMParser::SourceCitation * const src) |
GEDCOMParser::SourceCitation * GEDCOMParser::IndividualRecord::addSourceCitation(GEDCOMParser::SourceCitation * const data = 0) |
| 167 |
{ |
{ |
| 168 |
_citations.push_back(SmartPtr<SourceCitation>(src)); |
GEDCOMParser::SourceCitation * tmp_data = data; |
| 169 |
return; |
if (data == 0) |
| 170 |
|
{ |
| 171 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 172 |
|
GEDCOMParser::SourceCitation * tmp_data = factory->createSourceCitation(); |
| 173 |
|
} |
| 174 |
|
_citations.push_back(SmartPtr<SourceCitation>(tmp_data)); |
| 175 |
|
return _citations.back().getPtr(); |
| 176 |
} |
} |
| 177 |
|
|
| 178 |
void GEDCOMParser::IndividualRecord::addMultimediaLink(GEDCOMParser::MultimediaLink * const mml) |
GEDCOMParser::MultimediaLink * GEDCOMParser::IndividualRecord::addMultimediaLink(GEDCOMParser::MultimediaLink * const data = 0) |
| 179 |
{ |
{ |
| 180 |
_mm_links.push_back(SmartPtr<MultimediaLink>(mml)); |
GEDCOMParser::MultimediaLink * tmp_data = data; |
| 181 |
return; |
if (data == 0) |
| 182 |
|
{ |
| 183 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 184 |
|
GEDCOMParser::MultimediaLink * tmp_data = factory->createMultimediaLink(); |
| 185 |
|
} |
| 186 |
|
_mm_links.push_back(SmartPtr<MultimediaLink>(tmp_data)); |
| 187 |
|
return _mm_links.back().getPtr(); |
| 188 |
} |
} |
| 189 |
|
|
| 190 |
void GEDCOMParser::IndividualRecord::addNoteStructure(GEDCOMParser::NoteStructure * const note) |
GEDCOMParser::NoteStructure * GEDCOMParser::IndividualRecord::addNoteStructure(GEDCOMParser::NoteStructure * const data = 0) |
| 191 |
{ |
{ |
| 192 |
_notes.push_back(SmartPtr<NoteStructure>(note)); |
GEDCOMParser::NoteStructure * tmp_data = data; |
| 193 |
return; |
if (data == 0) |
| 194 |
|
{ |
| 195 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 196 |
|
GEDCOMParser::NoteStructure * tmp_data = factory->createNoteStructure(); |
| 197 |
|
} |
| 198 |
|
_notes.push_back(SmartPtr<NoteStructure>(tmp_data)); |
| 199 |
|
return _notes.back().getPtr(); |
| 200 |
} |
} |
| 201 |
|
|
| 202 |
void GEDCOMParser::IndividualRecord::setRfn(std::string const & value) |
void GEDCOMParser::IndividualRecord::setRfn(std::string const & value) |
| 211 |
return; |
return; |
| 212 |
} |
} |
| 213 |
|
|
| 214 |
void GEDCOMParser::IndividualRecord::addUserReference(GEDCOMParser::UserReference * const user) |
GEDCOMParser::UserReference * GEDCOMParser::IndividualRecord::addUserReference(GEDCOMParser::UserReference * const data = 0) |
| 215 |
{ |
{ |
| 216 |
_user_references.push_back(SmartPtr<UserReference>(user)); |
GEDCOMParser::UserReference * tmp_data = data; |
| 217 |
return; |
if (data == 0) |
| 218 |
|
{ |
| 219 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 220 |
|
GEDCOMParser::UserReference * tmp_data = factory->createUserReference(); |
| 221 |
|
} |
| 222 |
|
_user_references.push_back(SmartPtr<UserReference>(tmp_data)); |
| 223 |
|
return _user_references.back().getPtr(); |
| 224 |
} |
} |
| 225 |
|
|
| 226 |
void GEDCOMParser::IndividualRecord::setRin(std::string const & value) |
void GEDCOMParser::IndividualRecord::setRin(std::string const & value) |
| 229 |
return; |
return; |
| 230 |
} |
} |
| 231 |
|
|
| 232 |
void GEDCOMParser::IndividualRecord::setChangeDate(GEDCOMParser::ChangeDate * const chgdate) |
GEDCOMParser::ChangeDate * GEDCOMParser::IndividualRecord::setChangeDate(GEDCOMParser::ChangeDate * const data = 0) |
| 233 |
{ |
{ |
| 234 |
_change_date = SmartPtr<ChangeDate>(chgdate); |
GEDCOMParser::ChangeDate * tmp_data = data; |
| 235 |
return; |
if (data == 0) |
| 236 |
|
{ |
| 237 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 238 |
|
GEDCOMParser::ChangeDate * tmp_data = factory->createChangeDate(); |
| 239 |
|
} |
| 240 |
|
_change_date = SmartPtr<ChangeDate>(tmp_data); |
| 241 |
|
return _change_date.getPtr(); |
| 242 |
} |
} |
| 243 |
|
|
| 244 |
GEDCOMParser::IndividualRecord::~IndividualRecord (void) |
GEDCOMParser::IndividualRecord::~IndividualRecord (void) |