lsst.afw  13.0-91-g2a3e2ee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PropertyListFormatter.h
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 #ifndef LSST_AFW_FORMATTERS_PROPERTYLISTFORMATTER_H
26 #define LSST_AFW_FORMATTERS_PROPERTYLISTFORMATTER_H
27 
28 #include "lsst/daf/base.h"
29 #include "lsst/daf/persistence.h"
30 #include "lsst/pex/policy/Policy.h"
31 
32 namespace lsst {
33 namespace afw {
34 namespace formatters {
35 
39 class PropertyListFormatter : public daf::persistence::Formatter {
40 public:
42 
43  virtual void write(daf::base::Persistable const* persistable,
44  std::shared_ptr<daf::persistence::FormatterStorage> storage,
45  std::shared_ptr<daf::base::PropertySet> additionalData);
46 
47  virtual daf::base::Persistable* read(std::shared_ptr<daf::persistence::FormatterStorage> storage,
48  std::shared_ptr<daf::base::PropertySet> additionalData);
49 
50  virtual void update(daf::base::Persistable* persistable,
51  std::shared_ptr<daf::persistence::FormatterStorage> storage,
52  std::shared_ptr<daf::base::PropertySet> additionalData);
53 
54  static std::shared_ptr<daf::persistence::Formatter> createInstance(
55  std::shared_ptr<pex::policy::Policy> policy);
56 
57  template <class Archive>
58  static void delegateSerialize(Archive& ar, int const version, daf::base::Persistable* persistable);
59 
60 private:
61  explicit PropertyListFormatter(std::shared_ptr<pex::policy::Policy> policy);
62 
63  static daf::persistence::FormatterRegistration registration;
64 };
65 }
66 }
67 } // namespace lsst::afw::formatters
68 
69 #endif
virtual daf::base::Persistable * read(std::shared_ptr< daf::persistence::FormatterStorage > storage, std::shared_ptr< daf::base::PropertySet > additionalData)
Class implementing persistence and retrieval for PropertyLists.
virtual void write(daf::base::Persistable const *persistable, std::shared_ptr< daf::persistence::FormatterStorage > storage, std::shared_ptr< daf::base::PropertySet > additionalData)
version
Definition: conf.py:12
static std::shared_ptr< daf::persistence::Formatter > createInstance(std::shared_ptr< pex::policy::Policy > policy)
static void delegateSerialize(Archive &ar, int const version, daf::base::Persistable *persistable)
virtual void update(daf::base::Persistable *persistable, std::shared_ptr< daf::persistence::FormatterStorage > storage, std::shared_ptr< daf::base::PropertySet > additionalData)