rohdeschwarz  0.2.0
TCPIP socket library for Rohde & Schwarz instrument control
index_name.hpp
Go to the documentation of this file.
1 
7 #ifndef ROHDESCHWARZ_SCPI_INDEX_NAME_HPP
8 #define ROHDESCHWARZ_SCPI_INDEX_NAME_HPP
9 
10 
11 // std lib
12 #include <string>
13 #include <vector>
14 
15 
16 namespace rohdeschwarz::scpi
17 {
18 
19 
29 struct IndexName
30 {
31 
32 
33  unsigned int index;
34  std::string name;
35 
36 
37  // parse
38 
44  static std::vector<IndexName> parse(const char* csvList);
45 
46 
52  static std::vector<IndexName> parse(const std::string& csvList);
53 
54 
58  static std::vector<unsigned int> indexesFrom(const std::vector<IndexName>& list);
59 
60 
64  static std::vector<std::string> namesFrom(const std::vector<IndexName>& list);
65 
66 }; // IndexName
67 
68 
69 } // rohdeschwarz::scpi
70 #endif // ROHDESCHWARZ_SCPI_INDEX_NAME_HPP
Data type for handling named and indexed quantities.
Definition: index_name.hpp:30
static std::vector< unsigned int > indexesFrom(const std::vector< IndexName > &list)
Returns index list from IndexName list.
Definition: index_name.cpp:46
static std::vector< IndexName > parse(const char *csvList)
Parses index-name pairs from text.
Definition: index_name.cpp:17
static std::vector< std::string > namesFrom(const std::vector< IndexName > &list)
Returns names list from IndexName list.
Definition: index_name.cpp:61