DABC (Data Acquisition Backbone Core)  2.9.9
BinaryFileIO.h
Go to the documentation of this file.
1 // $Id: BinaryFileIO.h 3229 2015-07-03 09:16:10Z linev $
2 
3 /************************************************************
4  * The Data Acquisition Backbone Core (DABC) *
5  ************************************************************
6  * Copyright (C) 2009 - *
7  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
8  * Planckstr. 1, 64291 Darmstadt, Germany *
9  * Contact: http://dabc.gsi.de *
10  ************************************************************
11  * This software can be used under the GPL license *
12  * agreements as stated in LICENSE.txt file *
13  * which is part of the distribution. *
14  ************************************************************/
15 
16 #ifndef DABC_BinaryFileIO
17 #define DABC_BinaryFileIO
18 
19 #ifndef DABC_BinaryFile
20 #include "dabc/BinaryFile.h"
21 #endif
22 
23 #ifndef DABC_DataIO
24 #include "dabc/DataIO.h"
25 #endif
26 
27 namespace dabc {
28 
36  class BinaryFileInput : public FileInput {
37  protected:
39 
40  uint64_t fCurrentBufSize;
41  uint64_t fCurrentBufType;
42 
43  bool OpenNextFile();
44 
45  bool CloseFile();
46 
47  public:
48  BinaryFileInput(const dabc::Url& url);
49  virtual ~BinaryFileInput();
50 
51  virtual bool Read_Init(const WorkerRef& wrk, const Command& cmd);
52 
53  virtual unsigned Read_Size();
54  virtual unsigned Read_Complete(Buffer& buf);
55 
56  };
57 
58  // _________________________________________________________________
59 
67  class BinaryFileOutput : public FileOutput {
68  protected:
69 
71 
72  bool CloseFile();
73 
74  bool StartNewFile();
75 
76  public:
77  BinaryFileOutput(const dabc::Url& url);
78  virtual ~BinaryFileOutput();
79 
80  virtual bool Write_Init();
81 
82  virtual unsigned Write_Buffer(Buffer& buf);
83  };
84 
85 }
86 
87 
88 #endif
Binary file input object.
Definition: BinaryFileIO.h:36
BinaryFileInput(const dabc::Url &url)
virtual bool Read_Init(const WorkerRef &wrk, const Command &cmd)
Initialize data input, using port and command.
virtual unsigned Read_Size()
Defines required buffer size for next operation.
virtual unsigned Read_Complete(Buffer &buf)
Complete reading of the buffer from source,.
Binary file output object.
Definition: BinaryFileIO.h:67
BinaryFileOutput(const dabc::Url &url)
virtual bool Write_Init()
This is generic virtual method to initialize output before real work is started.
virtual unsigned Write_Buffer(Buffer &buf)
Start writing of buffer to output.
Generic file storage for DABC buffers.
Definition: BinaryFile.h:181
Reference on memory from memory pool.
Definition: Buffer.h:135
Represents command with its arguments.
Definition: Command.h:99
Interface for implementing file inputs.
Definition: DataIO.h:246
Interface for implementing file outputs.
Definition: DataIO.h:283
Uniform Resource Locator interpreter.
Definition: Url.h:33
Reference on dabc::Worker
Definition: Worker.h:466
Event manipulation API.
Definition: api.h:23