1 //                                               -*- C++ -*-
2 /**
3  *  @brief Class PersistentObjectFactory saves and reloads the object's internal state
4  *
5  *  Copyright 2005-2021 Airbus-EDF-IMACS-ONERA-Phimeca
6  *
7  *  This library is free software: you can redistribute it and/or modify
8  *  it under the terms of the GNU Lesser General Public License as published by
9  *  the Free Software Foundation, either version 3 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This library is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License
18  *  along with this library.  If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 #include "openturns/PersistentObjectFactory.hxx"
22 #include "openturns/Catalog.hxx"
23 
24 BEGIN_NAMESPACE_OPENTURNS
25 
26 
27 
28 /* Virtual constructor */
29 // PersistentObjectFactory * PersistentObjectFactory::clone() const = 0
30 
31 
32 /* This method register the factory into the Catalog */
registerMe(const String & className) const33 void PersistentObjectFactory::registerMe(const String & className) const
34 {
35   Catalog::Add(className, this);
36 }
37 
38 
39 /* Method build() creates a new PersistentObject from the storage manager */
40 // PersistentObject * PersistentObjectFactory::build(const StorageManager & mgr) const = 0;
41 
42 
43 /* Accessor to PersistentObject's shadowed id */
setShadowedId(PersistentObject & obj,Id id) const44 void PersistentObjectFactory::setShadowedId(PersistentObject & obj, Id id) const
45 {
46   obj.setShadowedId(id);
47 }
48 
getShadowedId(PersistentObject & obj) const49 Id PersistentObjectFactory::getShadowedId(PersistentObject & obj) const
50 {
51   return obj.getShadowedId();
52 }
53 
54 
55 END_NAMESPACE_OPENTURNS
56