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
36public:
37 typedef unsigned int offset_t ;
38 typedef std::vector<std::string> str_vector ;
39 typedef std::map<std::string, std::string> str_map ;
40protected:
41 static const char STRING_SEPARATOR ;
42 static const char MAP_ENTRY_SEPARATOR ;
43 virtual const char * string_area_read() const = 0 ;
44 virtual char* string_area_write() = 0 ;
45 virtual offset_t last_string() const = 0 ;
46 virtual void last_string(offset_t offset) = 0 ;
47 virtual size_t string_area_size() const = 0 ;
48public:
49 offset_t add(const char *str) ;
50 size_t clear(offset_t offset) ;
51 const char* get_string(offset_t offset) const ;
52 offset_t insert(offset_t offset, const char* str) ;
53 void insert(offset_t *offset, const char* str) ;
55 void insert(offset_t *offset, const str_vector &vect) ;
58 void insert(offset_t *offset, const str_map &map) ;
60 } ; // StringMemoryArea
61
62} // okssystem
63
64#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