Project
Loading...
Searching...
No Matches
FileWatcher.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef WATCHER_FILEWATCHER_H
17#define WATCHER_FILEWATCHER_H
18
19#include <string>
20#include <deque>
21#include <vector>
22
23namespace o2
24{
25namespace event_visualisation
26{
27
29{
30 static const char* mLowGuard;
31 static const char* mEndGuard;
32 std::deque<std::string> mFiles;
33 std::string nextItem(const std::string& item) const;
34 std::string prevItem(const std::string& item) const;
35 std::vector<std::string> mDataFolders;
36 std::string mCurrentFile;
37 const std::vector<std::string>& mExt;
38 bool currentFileExist();
39
40 public:
41 FileWatcher(const std::vector<std::string>& path, const std::vector<std::string>& ext);
42 void changeFolder(const std::string& path);
43 void changeFolder(const std::vector<std::string>& paths);
44 void saveCurrentFileToFolder(const std::string& destinationFolder);
45 int getSize() const;
46 int getPos() const;
47 void setFirst();
48 void setLast();
49 void setNext();
50 void setPrev();
51 void rollToNext();
52 bool refresh();
53 std::string currentItem() const;
54 void setCurrentItem(int no);
55 std::string currentFilePath() const;
56};
57
58} // namespace event_visualisation
59} // namespace o2
60
61#endif //WATCHER_FILEWATCHER_H
std::string currentFilePath() const
name of the file (with path) but guards replaced with file names
void saveCurrentFileToFolder(const std::string &destinationFolder)
copies
int getPos() const
include guards -> 0 points to mLowGuard
void setCurrentItem(int no)
sets using index
void rollToNext()
round robin next item
std::string currentItem() const
name of the file (without path) but guards replaced with file names
bool refresh()
reads folder content, updates current if points to not existing file
int getSize() const
include guards (so >=2 )
void changeFolder(const std::string &path)
switch to observe other folder
GLsizei const GLuint * paths
Definition glcorearb.h:5475
GLsizei const GLchar *const * path
Definition glcorearb.h:3591
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...