DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
StringMemoryArea.hpp
Go to the documentation of this file.
1// DUNE DAQ modification notice:
2// This file has been modified from the original ATLAS system source for the DUNE DAQ project.
3// Fork baseline commit: system-00-00-20 (2020-09-25).
4// Renamed since fork: yes (from system/StringMemoryArea.h to include/okssystem/StringMemoryArea.hpp).
5
6/*
7 * StringMemoryArea.h
8 * OksSystem
9 *
10 * Created by Matthias Wiesmann on 17.02.05.
11 * Copyright 2005 CERN. All rights reserved.
12 *
13 */
14
15#ifndef OKSSYSTEM_STRING_MEMORY_AREA
16#define OKSSYSTEM_STRING_MEMORY_AREA
17
18#include <map>
19#include <vector>
20
21namespace OksSystem {
22
34
36{
37public:
38 typedef unsigned int offset_t;
39 typedef std::vector<std::string> str_vector;
40 typedef std::map<std::string, std::string> str_map;
41
42protected:
43 static const char
45 static const char MAP_ENTRY_SEPARATOR;
46 virtual const char* string_area_read() const = 0;
47 virtual char* string_area_write() = 0;
48 virtual offset_t last_string() const = 0;
49 virtual void last_string(offset_t offset) = 0;
50 virtual size_t string_area_size() const = 0;
51public:
52 offset_t add(const char* str);
53 size_t clear(offset_t offset);
54 const char* get_string(offset_t offset) const;
55 offset_t insert(offset_t offset, const char* str);
56 void insert(offset_t* offset, const char* str);
58 void insert(offset_t* offset, const str_vector& vect);
61 void insert(offset_t* offset, const str_map& map);
63}; // StringMemoryArea
64
65} // okssystem
66
67#endif
String memory storage facility.
virtual char * string_area_write()=0
write pointer for the string area
std::map< std::string, std::string > str_map
virtual size_t string_area_size() const =0
size of the string area
size_t clear(offset_t offset)
const char * get_string(offset_t offset) const
virtual offset_t last_string() const =0
offset of the end of the last string
virtual void last_string(offset_t offset)=0
sets the offset of the end of last string
static const char STRING_SEPARATOR
character used to separate strings (i.e., to tokenize strings in vectors)
static const char MAP_ENTRY_SEPARATOR
character used to separate map entries
str_vector get_vector(offset_t offset) const
offset_t insert(offset_t offset, const char *str)
str_map get_map(offset_t offset) const
offset_t add(const char *str)
std::vector< std::string > str_vector
virtual const char * string_area_read() const =0
read pointer for the string area
double offset