Bayeux  3.4.1
Core Foundation library for SuperNEMO
simple_brio_data_sink.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date : 2011-06-07
4  * Last modified : 2013-02-16
5  *
6  * Copyright (C) 2011-2013 Francois Mauger <mauger@lpccaen.in2p3.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or (at
11  * your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  *
23  *
24  * Description:
25  *
26  * Generic data sink
27  *
28  */
29 
30 #ifndef DPP_SIMPLE_BRIO_DATA_SINK_H
31 #define DPP_SIMPLE_BRIO_DATA_SINK_H 1
32 
33 // Standard library:
34 #include <string>
35 
36 // Third party:
37 // - Bayeux/datatools:
38 #include <datatools/things.h>
39 
40 // This project:
41 #include <dpp/dpp_config.h>
42 #include <dpp/i_data_sink.h>
43 
44 // forward declaration:
45 namespace brio {
46  class writer;
47 }
48 
49 namespace dpp {
50 
53  : public i_data_sink
54  {
55 
56  protected:
57 
58  void _open_file_sink();
59 
60  void _close_file_sink();
61 
62  public:
63 
64  virtual bool is_random() const;
65 
66  virtual void open();
67 
68  virtual bool store_next_record(const datatools::things & a_event_record);
69 
70  virtual bool can_store_meta_data() const;
71 
72  virtual bool store_metadata(const datatools::properties & a_meta_data);
73 
74  virtual void close();
75 
76  virtual void reset();
77 
78  public:
79 
82 
83 
85  simple_brio_data_sink(const std::string & a_sink_label = "",
87 
89  virtual ~simple_brio_data_sink();
90 
91  private:
92 
93  brio::writer * _brio_file_writer_;
94 
95  };
96 
97 } // end of namespace dpp
98 
99 #endif // DPP_SIMPLE_BRIO_DATA_SINK_H
100 
101 // Local Variables: --
102 // mode: c++ --
103 // c-file-style: "gnu" --
104 // tab-width: 2 --
105 // End: --
A notice, which is an information with just a higher priority.
Definition: logger.h:89
A generic serializable and noncopyable container for arbitrary serializable objects.
Definition: things.h:85
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
The brio generic writer class.
Definition: writer.h:49
Top-level namespace of the Bayeux/dpp module library.
Definition: base_module.h:56
simple_brio_data_sink(datatools::logger::priority a_priority=datatools::logger::PRIO_NOTICE)
Constructor.
virtual bool store_metadata(const datatools::properties &a_meta_data)
header file
virtual bool is_random() const
Data sink/writer abstract interface.
Definition: i_data_sink.h:49
virtual ~simple_brio_data_sink()
Destructor.
virtual bool can_store_meta_data() const
virtual bool store_next_record(const datatools::things &a_event_record)
A brio-based I/O data sink/writer.
Definition: simple_brio_data_sink.h:52
Top-level namespace of the Bayeux/brio module library.
Definition: base_io.h:37
A dictionary of arbitrary properties.
Definition: properties.h:125