aimsdata  5.1.2
Neuroimaging data handling
argW.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 /*
35  * Data writer class
36  */
37 #ifndef AIMS_IO_ARGW_H
38 #define AIMS_IO_ARGW_H
39 
42 
43 class Graph;
44 
45 namespace aims
46 {
47 
50  {
51  public:
53  {
56  Local
57  };
58 
60  virtual ~LowLevelArgWriter();
62  virtual void write( const std::string & filename, Graph & graph,
63  SavingMode mode = Keep,
64  bool saveOnlyModified = true ) = 0;
70  virtual carto::Object getMinf( const Graph & g );
71  };
72 
73  /* This class is a wrapper for several GraphWriters: standard GraphWriter,
74  FoldWriter, FRGWriter (defined in sigraph library), etc. New writers can
75  be added as plugins.
76  */
77  class ArgWriter
78  {
79  public:
81  {
84  Local
85  };
86 
87  ArgWriter( const std::string& filename );
89  bool write( Graph &, SavingMode mode = Keep,
90  bool saveOnlyModified = true ) const;
93  static void registerWriter( const std::string & syntax,
94  LowLevelArgWriter *writer );
95  static bool hasWriter( const std::string & syntax );
97  static void deleteWriter( const std::string & syntax );
98 
99  private:
100  struct StaticPrivate;
101  static StaticPrivate* staticPrivate();
102 
103  std::string _name;
104  };
105 
108  {
109  public:
112  virtual void write( const std::string & filename, Graph & graph,
113  SavingMode mode = Keep, bool saveOnlyModified = true );
114 
115  private:
116  carto::SyntaxSet *_syntax;
117  };
118 
119 }
120 
121 #endif
122 
static bool hasWriter(const std::string &syntax)
static void registerWriter(const std::string &syntax, LowLevelArgWriter *writer)
sets the writer to use for graphs of a specific syntax.
ArgWriter(const std::string &filename)
bool write(Graph &, SavingMode mode=Keep, bool saveOnlyModified=true) const
static void deleteWriter(const std::string &syntax)
removes and deletes a writer
Wrapper for a specific GraphWriter.
Definition: argW.h:50
virtual carto::Object getMinf(const Graph &g)
get / reconstruct the minf header from the graph.
virtual void write(const std::string &filename, Graph &graph, SavingMode mode=Keep, bool saveOnlyModified=true)=0
in case of failure, raise an exception
Wrapper for the standard GraphWriter.
Definition: argW.h:108
virtual void write(const std::string &filename, Graph &graph, SavingMode mode=Keep, bool saveOnlyModified=true)
in case of failure, raise an exception
The class for EcatSino data write operation.
Definition: borderfiller.h:13
std::map< std::string, Syntax > SyntaxSet