MeVisLab Toolbox Reference
DCMTree_Serialization_File.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef DCM_TREE_SERIALIZATION_FILE_H
14#define DCM_TREE_SERIALIZATION_FILE_H
15
17
18#include <ctime>
19
20#include <cstdio>
21
22
24{
27 {
28 public:
29 FileSink (std::string filename);
30 ~FileSink() override;
31
32 void writeX(const void *data, boost::uint32_t size) override;
33
34 private:
35 FILE *_fp;
36
37 clock_t _tm;
38 };
39
42 {
43 public:
44 FileSource (std::string filename);
45 ~FileSource() override;
46
47 void readX(void *data, boost::uint32_t size) override;
48 void rewind() override;
49
50 private:
51 FILE *_fp;
52 clock_t _tm;
53 };
54}
55
56#endif
57
58
#define DCMTREE_EXPORT
Class to write DCMtree as file stream.
FileSink(std::string filename)
void writeX(const void *data, boost::uint32_t size) override
Writes a specified number of bytes.
Class to read DCMtree file stream.
FileSource(std::string filename)
void readX(void *data, boost::uint32_t size) override
Reads a specified number of bytes.
Interface of a data sink for the serialization of objects.
Interface of a data source for the deserialization of objects.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.