| 34 |
{ |
{ |
| 35 |
_submission = SmartPtr< Submission >(submission); |
_submission = SmartPtr< Submission >(submission); |
| 36 |
} |
} |
| 37 |
void GEDCOMParser::LineageLinkageGedcom::addFamilyRecord(FamilyRecord * const family_record) |
GEDCOMParser::FamilyRecord * GEDCOMParser::LineageLinkageGedcom::addFamilyRecord(FamilyRecord * const data = 0) |
| 38 |
{ |
{ |
| 39 |
_family_records[family_record->getId()] = SmartPtr< FamilyRecord >(family_record); |
std::string id; |
| 40 |
return; |
FamilyRecord * tmp_data; |
| 41 |
|
if (_id_generator == 0) |
| 42 |
|
{ |
| 43 |
|
_id_generator = new GEDCOMParser::IdGenerator(); |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
if (data == 0) |
| 47 |
|
{ |
| 48 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 49 |
|
tmp_data = factory->createFamilyRecord(_id_generator->getId()); |
| 50 |
|
} |
| 51 |
|
else |
| 52 |
|
{ |
| 53 |
|
tmp_data = data; |
| 54 |
|
} |
| 55 |
|
id = tmp_data->getId(); |
| 56 |
|
_family_records[id] = SmartPtr< FamilyRecord >(tmp_data); |
| 57 |
|
_id_generator->addUsedId(id); |
| 58 |
|
return _family_records[id].getPtr(); |
| 59 |
} |
} |
| 60 |
|
|
| 61 |
GEDCOMParser::IndividualRecord * GEDCOMParser::LineageLinkageGedcom::addIndividualRecord(IndividualRecord * const individual_record = 0) |
GEDCOMParser::IndividualRecord * GEDCOMParser::LineageLinkageGedcom::addIndividualRecord(IndividualRecord * const data = 0) |
| 62 |
{ |
{ |
| 63 |
std::string id; |
std::string id; |
| 64 |
IndividualRecord * tmp_indi; |
IndividualRecord * tmp_data; |
| 65 |
if (_id_generator == 0) |
if (_id_generator == 0) |
| 66 |
{ |
{ |
| 67 |
_id_generator = new GEDCOMParser::IdGenerator(); |
_id_generator = new GEDCOMParser::IdGenerator(); |
| 68 |
} |
} |
| 69 |
|
|
| 70 |
if (individual_record == 0) |
if (data == 0) |
| 71 |
{ |
{ |
| 72 |
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 73 |
tmp_indi = factory->createIndividualRecord(_id_generator->getId()); |
tmp_data = factory->createIndividualRecord(_id_generator->getId()); |
| 74 |
} |
} |
| 75 |
else |
else |
| 76 |
{ |
{ |
| 77 |
tmp_indi = individual_record; |
tmp_data = data; |
| 78 |
} |
} |
| 79 |
id = tmp_indi->getId(); |
id = tmp_data->getId(); |
| 80 |
_individual_records[id] = SmartPtr< IndividualRecord >(tmp_indi); |
_individual_records[id] = SmartPtr< IndividualRecord >(tmp_data); |
| 81 |
_id_generator->addUsedId(id); |
_id_generator->addUsedId(id); |
| 82 |
return _individual_records[id].getPtr(); |
return _individual_records[id].getPtr(); |
| 83 |
} |
} |
| 84 |
|
|
| 85 |
void GEDCOMParser::LineageLinkageGedcom::addMultimediaRecord(MultimediaRecord * const mm_record) |
GEDCOMParser::MultimediaRecord * GEDCOMParser::LineageLinkageGedcom::addMultimediaRecord(MultimediaRecord * const data = 0) |
| 86 |
{ |
{ |
| 87 |
_multimedia_records[mm_record->getId()] = SmartPtr< MultimediaRecord >(mm_record); |
std::string id; |
| 88 |
return; |
MultimediaRecord * tmp_data; |
| 89 |
|
if (_id_generator == 0) |
| 90 |
|
{ |
| 91 |
|
_id_generator = new GEDCOMParser::IdGenerator(); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
if (data == 0) |
| 95 |
|
{ |
| 96 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 97 |
|
tmp_data = factory->createMultimediaRecord(_id_generator->getId()); |
| 98 |
|
} |
| 99 |
|
else |
| 100 |
|
{ |
| 101 |
|
tmp_data = data; |
| 102 |
|
} |
| 103 |
|
id = tmp_data->getId(); |
| 104 |
|
_multimedia_records[id] = SmartPtr< MultimediaRecord >(tmp_data); |
| 105 |
|
_id_generator->addUsedId(id); |
| 106 |
|
return _multimedia_records[id].getPtr(); |
| 107 |
} |
} |
| 108 |
|
|
| 109 |
void GEDCOMParser::LineageLinkageGedcom::addNoteRecord(NoteRecord * const note_record) |
GEDCOMParser::NoteRecord * GEDCOMParser::LineageLinkageGedcom::addNoteRecord(NoteRecord * const data = 0) |
| 110 |
{ |
{ |
| 111 |
_note_records[note_record->getId()] = SmartPtr< NoteRecord >(note_record); |
std::string id; |
| 112 |
|
NoteRecord * tmp_data; |
| 113 |
|
if (_id_generator == 0) |
| 114 |
|
{ |
| 115 |
|
_id_generator = new GEDCOMParser::IdGenerator(); |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
if (data == 0) |
| 119 |
|
{ |
| 120 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 121 |
|
tmp_data = factory->createNoteRecord(_id_generator->getId()); |
| 122 |
|
} |
| 123 |
|
else |
| 124 |
|
{ |
| 125 |
|
tmp_data = data; |
| 126 |
|
} |
| 127 |
|
id = tmp_data->getId(); |
| 128 |
|
_note_records[id] = SmartPtr< NoteRecord >(tmp_data); |
| 129 |
|
_id_generator->addUsedId(id); |
| 130 |
|
return _note_records[id].getPtr(); |
| 131 |
|
|
| 132 |
} |
} |
| 133 |
|
|
| 134 |
void GEDCOMParser::LineageLinkageGedcom::addRepositoryRecord(RepositoryRecord * const repository_record) |
GEDCOMParser::RepositoryRecord * GEDCOMParser::LineageLinkageGedcom::addRepositoryRecord(RepositoryRecord * const data = 0) |
| 135 |
{ |
{ |
| 136 |
_repository_records[repository_record->getId()] = SmartPtr< RepositoryRecord >(repository_record); |
std::string id; |
| 137 |
return; |
RepositoryRecord * tmp_data; |
| 138 |
|
if (_id_generator == 0) |
| 139 |
|
{ |
| 140 |
|
_id_generator = new GEDCOMParser::IdGenerator(); |
| 141 |
|
} |
| 142 |
|
|
| 143 |
|
if (data == 0) |
| 144 |
|
{ |
| 145 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 146 |
|
tmp_data = factory->createRepositoryRecord(_id_generator->getId()); |
| 147 |
|
} |
| 148 |
|
else |
| 149 |
|
{ |
| 150 |
|
tmp_data = data; |
| 151 |
|
} |
| 152 |
|
id = tmp_data->getId(); |
| 153 |
|
_repository_records[id] = SmartPtr< RepositoryRecord >(tmp_data); |
| 154 |
|
_id_generator->addUsedId(id); |
| 155 |
|
return _repository_records[id].getPtr(); |
| 156 |
} |
} |
| 157 |
|
|
| 158 |
void GEDCOMParser::LineageLinkageGedcom::addSourceRecord(SourceRecord * const source_record) |
GEDCOMParser::SourceRecord * GEDCOMParser::LineageLinkageGedcom::addSourceRecord(SourceRecord * const data = 0) |
| 159 |
{ |
{ |
| 160 |
_source_records[source_record->getId()] = SmartPtr< SourceRecord >(source_record); |
std::string id; |
| 161 |
return; |
SourceRecord * tmp_data; |
| 162 |
|
if (_id_generator == 0) |
| 163 |
|
{ |
| 164 |
|
_id_generator = new GEDCOMParser::IdGenerator(); |
| 165 |
|
} |
| 166 |
|
|
| 167 |
|
if (data == 0) |
| 168 |
|
{ |
| 169 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 170 |
|
tmp_data = factory->createSourceRecord(_id_generator->getId()); |
| 171 |
|
} |
| 172 |
|
else |
| 173 |
|
{ |
| 174 |
|
tmp_data = data; |
| 175 |
|
} |
| 176 |
|
id = tmp_data->getId(); |
| 177 |
|
_source_records[id] = SmartPtr< SourceRecord >(tmp_data); |
| 178 |
|
_id_generator->addUsedId(id); |
| 179 |
|
return _source_records[id].getPtr(); |
| 180 |
} |
} |
| 181 |
|
|
| 182 |
void GEDCOMParser::LineageLinkageGedcom::addSubmitterRecord(SubmitterRecord * const submitter_record) |
GEDCOMParser::SubmitterRecord * GEDCOMParser::LineageLinkageGedcom::addSubmitterRecord(SubmitterRecord * const data = 0) |
| 183 |
{ |
{ |
| 184 |
_submitter_records[submitter_record->getId()] = SmartPtr< SubmitterRecord >(submitter_record); |
std::string id; |
| 185 |
|
SubmitterRecord * tmp_data; |
| 186 |
|
if (_id_generator == 0) |
| 187 |
|
{ |
| 188 |
|
_id_generator = new GEDCOMParser::IdGenerator(); |
| 189 |
|
} |
| 190 |
|
|
| 191 |
|
if (data == 0) |
| 192 |
|
{ |
| 193 |
|
GEDCOMParser::GEDCOMFactory * factory = GEDCOMParser::GEDCOMFactoryAccessor::getFactory(); |
| 194 |
|
tmp_data = factory->createSubmitterRecord(_id_generator->getId()); |
| 195 |
|
} |
| 196 |
|
else |
| 197 |
|
{ |
| 198 |
|
tmp_data = data; |
| 199 |
|
} |
| 200 |
|
id = tmp_data->getId(); |
| 201 |
|
_submitter_records[id] = SmartPtr< SubmitterRecord >(tmp_data); |
| 202 |
|
_id_generator->addUsedId(id); |
| 203 |
|
return _submitter_records[id].getPtr(); |
| 204 |
} |
} |
| 205 |
|
|
| 206 |
SmartPtr<GEDCOMParser::Header> const & GEDCOMParser::LineageLinkageGedcom::getHeader(void) const |
SmartPtr<GEDCOMParser::Header> const & GEDCOMParser::LineageLinkageGedcom::getHeader(void) const |