Free Electron
StringAccessor.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __datatool_StringAccessor_h__
8 #define __datatool_StringAccessor_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /** Access attributes as string lists, one string per sub item.
16 
17  Supported attribute types:
18 
19  - String: 1 item
20  - int: 1 item
21  - Real: 1 item
22  - SpatialVector: 3 items, 1 per dimension
23 
24 
25  */
27 {
28  public:
29  StringAccessor(void);
30 virtual ~StringAccessor(void);
31 
32 virtual void bind(sp<Scope> spScope);
33 virtual int setup(sp<Layout> spLayout, const String &a_attrname);
34 virtual void get(Record r_has, Array<String> &a_values);
35 virtual void set(Record r_has, const String &a_value, int a_index = 0);
36 
37 virtual void setRealFormat(const String &a_format);
38 virtual void setIntegerFormat(const String &a_format);
39 virtual void setStringFormat(const String &a_format);
40 
41  private:
42  sp<BaseType> m_spStringType;
43  sp<BaseType> m_spRealType;
44  sp<BaseType> m_spIntType;
45  sp<BaseType> m_spSpatialVectorType;
46  sp<BaseType> m_type;
47  Accessor<String> m_aString;
48  Accessor<Real> m_aReal;
49  Accessor<SpatialVector> m_aSpatialV;
50  Accessor<int> m_aInt;
51  BaseAccessor m_aBase;
52  sp<Layout> m_layout;
53 
54  String m_intFormat;
55  String m_strFormat;
56  String m_realFormat;
57 
58 };
59 
60 } /* namespace ext */
61 } /* namespace fe */
62 
63 #endif /* __datatool_StringAccessor_h__ */
64 
kernel
Definition: namespace.dox:3
Access attributes as string lists, one string per sub item.
Definition: StringAccessor.h:26
Type inspecific Accessor.
Definition: Accessor.h:26
Automatically reference-counted string container.
Definition: String.h:128
Wrapper for std::vector.
Definition: Array.h:21
Reference to an instance of a Layout.
Definition: RecordSB.h:35