LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
ResultFormatters.cc
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008, 2009, 2010 LSST Corporation.
6  *
7  * This product includes software developed by the
8  * LSST Project (http://www.lsst.org/).
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the LSST License Statement and
21  * the GNU General Public License along with this program. If not,
22  * see <http://www.lsstcorp.org/LegalNotices/>.
23  */
24 
25 
33 #include <memory>
34 
35 #include "boost/format.hpp"
36 //#include "boost/serialization/export.hpp"
37 
38 #include "lsst/pex/exceptions.h"
45 
47 
48 #include "lsst/ap/Common.h"
49 #include "lsst/ap/Results.h"
50 #include "lsst/ap/Utils.h"
52 
53 //BOOST_CLASS_EXPORT(lsst::ap::MatchPairVector)
54 //BOOST_CLASS_EXPORT(lsst::ap::IdVector)
55 
65 
66 namespace ex = lsst::pex::exceptions;
67 namespace fmt = lsst::afw::formatters;
68 
69 // -- MatchPairVectorFormatter ----------------
70 
72  Formatter(typeid(*this)),
73  _policy(policy)
74 {}
75 
76 
78 
79 
81  "PersistableMatchPairVector",
83  createInstance
84 );
85 
86 
87 Formatter::Ptr lsst::ap::io::MatchPairVectorFormatter::createInstance(Policy::Ptr policy) {
88  return Formatter::Ptr(new MatchPairVectorFormatter(policy));
89 }
90 
91 
92 template <class Archive>
94  Archive & archive,
95  unsigned int const version,
96  Persistable * persistable
97 ) {
98  PersistableMatchPairVector * p = dynamic_cast<PersistableMatchPairVector *>(persistable);
99  MatchPairVector::size_type sz;
100  MatchPairVector & vec = p->getMatchPairs();
101 
102  if (Archive::is_loading::value) {
103  MatchPair data;
104  archive & sz;
105  vec.reserve(sz);
106  for (; sz > 0; --sz) {
107  archive & data;
108  vec.push_back(data);
109  }
110  } else {
111  sz = vec.size();
112  archive & sz;
113  for (MatchPairVector::iterator i(vec.begin()), end(vec.end()); i != end; ++i) {
114  archive & *i;
115  }
116  }
117 }
118 
120 template void lsst::ap::io::MatchPairVectorFormatter::delegateSerialize<boost::archive::text_oarchive>(
121  boost::archive::text_oarchive &, unsigned int const, Persistable *
122 );
123 template void lsst::ap::io::MatchPairVectorFormatter::delegateSerialize<boost::archive::text_iarchive>(
124  boost::archive::text_iarchive &, unsigned int const, Persistable *
125 );
126 //template void lsst::ap::io::MatchPairVector::delegateSerialize<boost::archive::binary_oarchive>(
127 // boost::archive::binary_oarchive &, unsigned int const, Persistable *
128 //);
129 //template void lsst::ap::io::MatchPairVector::delegateSerialize<boost::archive::binary_iarchive>(
130 // boost::archive::binary_iarchive &, unsigned int const, Persistable *
131 //);
133 
134 
136  Persistable const * persistable,
137  Storage::Ptr storage,
138  PropertySet::Ptr additionalData
139 ) {
140  if (persistable == 0) {
141  throw LSST_EXCEPT(ex::InvalidParameterError, "No Persistable provided");
142  }
143  if (!storage) {
144  throw LSST_EXCEPT(ex::InvalidParameterError, "No Storage provided");
145  }
146 
147  PersistableMatchPairVector const * p = dynamic_cast<PersistableMatchPairVector const *>(persistable);
148  if (p == 0) {
149  throw LSST_EXCEPT(ex::RuntimeError,
150  "Persistable was not of concrete type PersistableMatchPairVector");
151  }
152 
153  if (typeid(*storage) == typeid(BoostStorage)) {
154  BoostStorage * bs = dynamic_cast<BoostStorage *>(storage.get());
155  if (bs == 0) {
156  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get BoostStorage");
157  }
158  bs->getOArchive() & *p;
159  } else if (typeid(*storage) == typeid(DbStorage) || typeid(*storage) == typeid(DbTsvStorage)) {
160  std::string name = fmt::getTableName(_policy, additionalData);
161  std::string model = _policy->getString(fmt::getItemName(additionalData) + ".templateTableName");
162  MatchPairVector const & v = p->getMatchPairs();
163  if (typeid(*storage) == typeid(DbStorage)) {
164  DbStorage * db = dynamic_cast<DbStorage *>(storage.get());
165  if (db == 0) {
166  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get DbStorage");
167  }
168  db->createTableFromTemplate(name, model, false);
169  db->setTableForInsert(name);
170  for (MatchPairVector::const_iterator i(v.begin()), end(v.end()); i != end; ++i) {
171  db->setColumn<boost::int64_t>("first", i->_first);
172  db->setColumn<boost::int64_t>("second", i->_second);
173  db->setColumn<double> ("distance", i->_distance);
174  db->insertRow();
175  }
176  } else {
177  DbTsvStorage * db = dynamic_cast<DbTsvStorage *>(storage.get());
178  if (db == 0) {
179  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get DbTsvStorage");
180  }
181  db->createTableFromTemplate(name, model, false);
182  db->setTableForInsert(name);
183  for (MatchPairVector::const_iterator i(v.begin()), end(v.end()); i != end; ++i) {
184  db->setColumn<boost::int64_t>("first", i->_first);
185  db->setColumn<boost::int64_t>("second", i->_second);
186  db->setColumn<double> ("distance", i->_distance);
187  db->insertRow();
188  }
189  }
190  } else {
191  throw LSST_EXCEPT(ex::InvalidParameterError, "Storage type is not supported");
192  }
193 }
194 
195 
197  Storage::Ptr storage,
198  PropertySet::Ptr additionalData
199 ) {
200  std::auto_ptr<PersistableMatchPairVector> p(new PersistableMatchPairVector);
201 
202  if (typeid(*storage) == typeid(BoostStorage)) {
203  BoostStorage * bs = dynamic_cast<BoostStorage *>(storage.get());
204  if (bs == 0) {
205  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get BoostStorage");
206  }
207  bs->getIArchive() & *p;
208  } else if (typeid(*storage) == typeid(DbStorage) || typeid(*storage) == typeid(DbTsvStorage)) {
209  DbStorage * db = dynamic_cast<DbStorage *>(storage.get());
210  if (db == 0) {
211  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get DbStorage");
212  }
213  db->setTableForQuery(fmt::getTableName(_policy, additionalData));
214  MatchPair data;
215  db->outParam("first", &(data._first));
216  db->outParam("second", &(data._second));
217  db->outParam("distance", &(data._distance));
218  db->query();
219  while (db->next()) {
220  if (db->columnIsNull(0)) {
221  throw LSST_EXCEPT(ex::RuntimeError, "null column \"first\"");
222  }
223  if (db->columnIsNull(1)) {
224  throw LSST_EXCEPT(ex::RuntimeError, "null column \"second\"");
225  }
226  if (db->columnIsNull(2)) {
227  throw LSST_EXCEPT(ex::RuntimeError, "null column \"distance\"");
228  }
229  p->getMatchPairs().push_back(data);
230  }
231  db->finishQuery();
232  } else {
233  throw LSST_EXCEPT(ex::InvalidParameterError, "Storage type is not supported");
234  }
235  return p.release();
236 }
237 
238 
240  throw LSST_EXCEPT(ex::RuntimeError, "MatchPairVectorFormatter: updates not supported");
241 }
242 
243 
244 // -- IdPairVectorFormatter ----------------
245 
247  Formatter(typeid(*this)),
248  _policy(policy)
249 {}
250 
251 
253 
254 
256  "PersistableIdPairVector",
257  typeid(PersistableIdPairVector),
258  createInstance
259 );
260 
261 
262 Formatter::Ptr lsst::ap::io::IdPairVectorFormatter::createInstance(Policy::Ptr policy) {
263  return Formatter::Ptr(new IdPairVectorFormatter(policy));
264 }
265 
266 
267 template <class Archive>
269  Archive & archive,
270  unsigned int const version,
271  Persistable * persistable
272 ) {
273  PersistableIdPairVector * p = dynamic_cast<PersistableIdPairVector *>(persistable);
274  IdPairVector::size_type sz;
275  IdPairVector & vec = p->getIdPairs();
276 
277  if (Archive::is_loading::value) {
278  IdPair data;
279  archive & sz;
280  vec.reserve(sz);
281  for (; sz > 0; --sz) {
282  archive & data.first;
283  archive & data.second;
284  vec.push_back(data);
285  }
286  } else {
287  sz = vec.size();
288  archive & sz;
289  for (IdPairVector::iterator i(vec.begin()), end(vec.end()); i != end; ++i) {
290  archive & i->first;
291  archive & i->second;
292  }
293  }
294 }
295 
297 template void lsst::ap::io::IdPairVectorFormatter::delegateSerialize<boost::archive::text_oarchive>(
298  boost::archive::text_oarchive &, unsigned int const, Persistable *
299 );
300 template void lsst::ap::io::IdPairVectorFormatter::delegateSerialize<boost::archive::text_iarchive>(
301  boost::archive::text_iarchive &, unsigned int const, Persistable *
302 );
303 //template void lsst::ap::io::IdPairVectorFormatter::delegateSerialize<boost::archive::binary_oarchive>(
304 // boost::archive::binary_oarchive &, unsigned int const, Persistable *
305 //);
306 //template void lsst::ap::io::IdPairVectorFormatter::delegateSerialize<boost::archive::binary_iarchive>(
307 // boost::archive::binary_iarchive &, unsigned int const, Persistable *
308 //);
310 
311 
313  Persistable const * persistable,
314  Storage::Ptr storage,
315  PropertySet::Ptr additionalData
316 ) {
317  if (persistable == 0) {
318  throw LSST_EXCEPT(ex::InvalidParameterError, "No Persistable provided");
319  }
320  if (!storage) {
321  throw LSST_EXCEPT(ex::InvalidParameterError, "No Storage provided");
322  }
323 
324  PersistableIdPairVector const * p = dynamic_cast<PersistableIdPairVector const *>(persistable);
325  if (p == 0) {
326  throw LSST_EXCEPT(ex::RuntimeError, "Persistable was not of concrete type IdPairVector");
327  }
328 
329  if (typeid(*storage) == typeid(BoostStorage)) {
330  BoostStorage * bs = dynamic_cast<BoostStorage *>(storage.get());
331  if (bs == 0) {
332  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get BoostStorage");
333  }
334  bs->getOArchive() & *p;
335  } else if (typeid(*storage) == typeid(DbStorage) || typeid(*storage) == typeid(DbTsvStorage)) {
336  std::string name = fmt::getTableName(_policy, additionalData);
337  std::string model = _policy->getString(fmt::getItemName(additionalData) + ".templateTableName");
338  IdPairVector const & v = p->getIdPairs();
339  if (typeid(*storage) == typeid(DbStorage)) {
340  DbStorage * db = dynamic_cast<DbStorage *>(storage.get());
341  if (db == 0) {
342  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get DbStorage");
343  }
344  db->createTableFromTemplate(name, model, false);
345  db->setTableForInsert(name);
346  for (IdPairVector::const_iterator i(v.begin()), end(v.end()); i != end; ++i) {
347  db->setColumn<boost::int64_t>("first", i->first);
348  db->setColumn<boost::int64_t>("second", i->second);
349  db->insertRow();
350  }
351  } else {
352  DbTsvStorage * db = dynamic_cast<DbTsvStorage *>(storage.get());
353  if (db == 0) {
354  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get DbTsvStorage");
355  }
356  db->createTableFromTemplate(name, model, false);
357  db->setTableForInsert(name);
358  for (IdPairVector::const_iterator i(v.begin()), end(v.end()); i != end; ++i) {
359  db->setColumn<boost::int64_t>("first", i->first);
360  db->setColumn<boost::int64_t>("second", i->second);
361  db->insertRow();
362  }
363  }
364  } else {
365  throw LSST_EXCEPT(ex::InvalidParameterError, "Storage type is not supported");
366  }
367 }
368 
369 
371  Storage::Ptr storage,
372  PropertySet::Ptr additionalData
373 ) {
374  std::auto_ptr<PersistableIdPairVector> p(new PersistableIdPairVector);
375 
376  if (typeid(*storage) == typeid(BoostStorage)) {
377  BoostStorage* bs = dynamic_cast<BoostStorage *>(storage.get());
378  if (bs == 0) {
379  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get BoostStorage");
380  }
381  bs->getIArchive() & *p;
382  } else if (typeid(*storage) == typeid(DbStorage) || typeid(*storage) == typeid(DbTsvStorage)) {
383  DbStorage * db = dynamic_cast<DbStorage *>(storage.get());
384  if (db == 0) {
385  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get DbStorage");
386  }
387 
388  db->setTableForQuery(fmt::getTableName(_policy, additionalData));
389  IdPair data;
390  db->outParam("first", &data.first);
391  db->outParam("second", &data.second);
392  db->query();
393  while (db->next()) {
394  if (db->columnIsNull(0)) {
395  throw LSST_EXCEPT(ex::RuntimeError, "null column \"first\"");
396  }
397  if (db->columnIsNull(1)) {
398  throw LSST_EXCEPT(ex::RuntimeError, "null column \"second\"");
399  }
400  p->getIdPairs().push_back(data);
401  }
402  db->finishQuery();
403  } else {
404  throw LSST_EXCEPT(ex::InvalidParameterError, "Storage type is not supported");
405  }
406  return p.release();
407 }
408 
409 
411  throw LSST_EXCEPT(ex::RuntimeError, "IdPairVectorFormatter: updates not supported");
412 }
413 
414 
415 // -- IdVectorFormatter ----------------
416 
418  Formatter(typeid(*this)),
419  _policy(policy)
420 {}
421 
422 
424 
425 
427  "PersistableIdVector",
428  typeid(PersistableIdVector),
429  createInstance
430 );
431 
432 
433 Formatter::Ptr lsst::ap::io::IdVectorFormatter::createInstance(Policy::Ptr policy) {
434  return Formatter::Ptr(new IdVectorFormatter(policy));
435 }
436 
437 
438 template <class Archive>
440  Archive & archive,
441  unsigned int const version,
442  Persistable * persistable
443 ) {
444  PersistableIdVector * p = dynamic_cast<PersistableIdVector *>(persistable);
445  IdVector::size_type sz;
446  IdVector & vec = p->getIds();
447 
448  if (Archive::is_loading::value) {
449  boost::int64_t data;
450  archive & sz;
451  vec.reserve(sz);
452  for (; sz > 0; --sz) {
453  archive & data;
454  vec.push_back(data);
455  }
456  } else {
457  sz = vec.size();
458  archive & sz;
459  for (IdVector::iterator i(vec.begin()), end(vec.end()); i != end; ++i) {
460  archive & *i;
461  }
462  }
463 }
464 
466 template void lsst::ap::io::IdVectorFormatter::delegateSerialize<boost::archive::text_oarchive>(
467  boost::archive::text_oarchive &, unsigned int const, Persistable *
468 );
469 template void lsst::ap::io::IdVectorFormatter::delegateSerialize<boost::archive::text_iarchive>(
470  boost::archive::text_iarchive &, unsigned int const, Persistable *
471 );
472 //template void lsst::ap::io::IdVectorFormatter::delegateSerialize<boost::archive::binary_oarchive>(
473 // boost::archive::binary_oarchive &, unsigned int const, Persistable *
474 //);
475 //template void lsst::ap::io::IdVectorFormatter::delegateSerialize<boost::archive::binary_iarchive>(
476 // boost::archive::binary_iarchive &, unsigned int const, Persistable *
477 //);
479 
480 
482  Persistable const * persistable,
483  Storage::Ptr storage,
484  PropertySet::Ptr additionalData
485 ) {
486  if (persistable == 0) {
487  throw LSST_EXCEPT(ex::InvalidParameterError, "No Persistable provided");
488  }
489  if (!storage) {
490  throw LSST_EXCEPT(ex::InvalidParameterError, "No Storage provided");
491  }
492 
493  PersistableIdVector const * p = dynamic_cast<PersistableIdVector const *>(persistable);
494  if (p == 0) {
495  throw LSST_EXCEPT(ex::RuntimeError, "Persistable was not of concrete type IdVector");
496  }
497 
498  if (typeid(*storage) == typeid(BoostStorage)) {
499  BoostStorage * bs = dynamic_cast<BoostStorage *>(storage.get());
500  if (bs == 0) {
501  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get BoostStorage");
502  }
503  bs->getOArchive() & *p;
504  } else if (typeid(*storage) == typeid(DbStorage) || typeid(*storage) == typeid(DbTsvStorage)) {
505  std::string name = fmt::getTableName(_policy, additionalData);
506  std::string model = _policy->getString(fmt::getItemName(additionalData) + ".templateTableName");
507  IdVector const & v = p->getIds();
508  if (typeid(*storage) == typeid(DbStorage)) {
509  DbStorage * db = dynamic_cast<DbStorage *>(storage.get());
510  if (db == 0) {
511  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get DbStorage");
512  }
513  db->createTableFromTemplate(name, model, false);
514  db->setTableForInsert(name);
515  for (IdVector::const_iterator i(v.begin()), end(v.end()); i != end; ++i) {
516  db->setColumn<boost::int64_t>("id", *i);
517  db->insertRow();
518  }
519  } else {
520  DbTsvStorage * db = dynamic_cast<DbTsvStorage *>(storage.get());
521  if (db == 0) {
522  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get DbTsvStorage");
523  }
524  db->createTableFromTemplate(name, model, false);
525  db->setTableForInsert(name);
526  for (IdVector::const_iterator i(v.begin()), end(v.end()); i != end; ++i) {
527  db->setColumn<long long>("id", *i);
528  db->insertRow();
529  }
530  }
531  } else {
532  throw LSST_EXCEPT(ex::InvalidParameterError, "Storage type is not supported");
533  }
534 }
535 
536 
538  Storage::Ptr storage,
539  PropertySet::Ptr additionalData
540 ) {
541  std::auto_ptr<PersistableIdVector> p(new PersistableIdVector);
542 
543  if (typeid(*storage) == typeid(BoostStorage)) {
544  BoostStorage* bs = dynamic_cast<BoostStorage *>(storage.get());
545  if (bs == 0) {
546  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get BoostStorage");
547  }
548  bs->getIArchive() & *p;
549  } else if (typeid(*storage) == typeid(DbStorage) || typeid(*storage) == typeid(DbTsvStorage)) {
550  DbStorage * db = dynamic_cast<DbStorage *>(storage.get());
551  if (db == 0) {
552  throw LSST_EXCEPT(ex::RuntimeError, "Didn't get DbStorage");
553  }
554 
555  db->setTableForQuery(fmt::getTableName(_policy, additionalData));
556  boost::int64_t data;
557  db->outParam("id", &data);
558  db->query();
559  while (db->next()) {
560  if (db->columnIsNull(0)) {
561  throw LSST_EXCEPT(ex::RuntimeError, "null column \"id\"");
562  }
563  p->getIds().push_back(data);
564  }
565  db->finishQuery();
566  } else {
567  throw LSST_EXCEPT(ex::InvalidParameterError, "Storage type is not supported");
568  }
569  return p.release();
570 }
571 
572 
574  throw LSST_EXCEPT(ex::RuntimeError, "IdVectorFormatter: updates not supported");
575 }
576 
virtual void update(lsst::daf::base::Persistable *, lsst::daf::persistence::Storage::Ptr, lsst::daf::base::PropertySet::Ptr)
Formatter for IdPairVector instances.
Holds a pair of ids and the distance between the corresponding positions on the unit sphere...
Definition: Results.h:65
std::vector< boost::int64_t > IdVector
A list of integer ids.
Definition: Results.h:127
IdVectorFormatter(lsst::pex::policy::Policy::Ptr)
std::string const getItemName(boost::shared_ptr< lsst::daf::base::PropertySet const > const &properties)
virtual void write(lsst::daf::base::Persistable const *, lsst::daf::persistence::Storage::Ptr, lsst::daf::base::PropertySet::Ptr)
Interface for DbStorage class.
Formatting utilities.
virtual void createTableFromTemplate(std::string const &tableName, std::string const &templateName, bool mayAlreadyExist=false)
Definition: DbStorage.cc:112
virtual void setTableForQuery(std::string const &tableName, bool isExpr=false)
Definition: DbStorage.cc:175
a container for holding hierarchical configuration data in memory.
Definition: Policy.h:169
static lsst::daf::persistence::Formatter::Ptr createInstance(lsst::pex::policy::Policy::Ptr)
static void delegateSerialize(Archive &, unsigned int const, lsst::daf::base::Persistable *)
static lsst::daf::persistence::FormatterRegistration registration
static void delegateSerialize(Archive &, unsigned int const, lsst::daf::base::Persistable *)
virtual void write(lsst::daf::base::Persistable const *, lsst::daf::persistence::Storage::Ptr, lsst::daf::base::PropertySet::Ptr)
virtual lsst::daf::base::Persistable * read(lsst::daf::persistence::Storage::Ptr, lsst::daf::base::PropertySet::Ptr)
virtual lsst::daf::base::Persistable * read(lsst::daf::persistence::Storage::Ptr, lsst::daf::base::PropertySet::Ptr)
virtual void write(lsst::daf::base::Persistable const *, lsst::daf::persistence::Storage::Ptr, lsst::daf::base::PropertySet::Ptr)
static lsst::daf::persistence::FormatterRegistration registration
Construct a static instance of this helper class to register a Formatter subclass in the FormatterReg...
Definition: Formatter.h:138
virtual boost::archive::text_oarchive & getOArchive(void)
Miscellaneous helper methods.
std::vector< MatchPair > MatchPairVector
A list of MatchPair instances.
Definition: Results.h:123
virtual void update(lsst::daf::base::Persistable *, lsst::daf::persistence::Storage::Ptr, lsst::daf::base::PropertySet::Ptr)
A persistable wrapper for a MatchPairVector.
Definition: Results.h:131
static lsst::daf::persistence::FormatterRegistration registration
Class for database storage.
Definition: DbStorage.h:63
A persistable wrapper for an IdPairVector.
Definition: Results.h:164
lsst::daf::base::PropertySet PropertySet
Definition: Wcs.cc:57
static void delegateSerialize(Archive &, unsigned int const, lsst::daf::base::Persistable *)
virtual void insertRow(void)
Definition: DbStorage.cc:166
Interface for DbTsvStorage class.
virtual void setTableForInsert(std::string const &tableName)
Definition: DbStorage.cc:143
std::pair< boost::int64_t, boost::int64_t > IdPair
Holds a pair of ids.
Definition: Results.h:121
boost::int64_t _second
Definition: Results.h:105
std::vector< IdPair > IdPairVector
A list of IdPair instances.
Definition: Results.h:125
Abstract base class for all formatters.
Definition: Formatter.h:79
void setColumn(std::string const &columnName, T const &value)
static lsst::daf::persistence::Formatter::Ptr createInstance(lsst::pex::policy::Policy::Ptr)
IdPairVector & getIdPairs()
Definition: Results.h:175
MatchPairVectorFormatter(lsst::pex::policy::Policy::Ptr)
void outParam(std::string const &columnName, T *location, bool isExpr=false)
Definition: DbStorage.cc:207
void setColumn(std::string const &columnName, T const &value)
Definition: DbStorage.cc:152
Master header file for the association pipeline.
Class for database storage with data loading from TSV files.
Definition: DbTsvStorage.h:66
virtual boost::archive::text_iarchive & getIArchive(void)
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
Formatter for MatchPairVector instances.
Auxiliary global template function for Formatter subclasses.
virtual void query(void)
Definition: DbStorage.cc:248
MatchPairVector & getMatchPairs()
Definition: Results.h:142
virtual void update(lsst::daf::base::Persistable *, lsst::daf::persistence::Storage::Ptr, lsst::daf::base::PropertySet::Ptr)
virtual void finishQuery(void)
Definition: DbStorage.cc:278
Interface for Persistable base class.
Class for boost::serialization storage.
Definition: BoostStorage.h:58
boost::int64_t _first
Definition: Results.h:104
virtual void setTableForInsert(std::string const &tableName)
Interface for PropertySet class.
Base class for all persistable classes.
Definition: Persistable.h:74
boost::shared_ptr< PropertySet > Ptr
Definition: PropertySet.h:90
virtual void createTableFromTemplate(std::string const &tableName, std::string const &templateName, bool mayAlreadyExist=false)
Formatter for IdVector instances.
A persistable wrapper for an IdVector.
Definition: Results.h:197
std::string const getTableName(boost::shared_ptr< lsst::pex::policy::Policy const > const &policy, boost::shared_ptr< lsst::daf::base::PropertySet const > const &properties)
IdPairVectorFormatter(lsst::pex::policy::Policy::Ptr)
static lsst::daf::persistence::Formatter::Ptr createInstance(lsst::pex::policy::Policy::Ptr)
Persistable vectors for association pipeline results.
virtual lsst::daf::base::Persistable * read(lsst::daf::persistence::Storage::Ptr, lsst::daf::base::PropertySet::Ptr)
Include files required for standard LSST Exception handling.
Abstract base class for storage implementations.
Definition: Storage.h:60
Interface for BoostStorage class.
Formatter subclasses for association pipeline result vectors.