WSF
WsfPProxyList.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11// ****************************************************************************
12// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFPPROXYLIST_HPP
16#define WSFPPROXYLIST_HPP
17
18#include <vector>
19
20#include "UtMemoryDebug.hpp"
21
22// clang-format off
23#include "WsfPProxyValue.hpp"
24#include "WsfPProxyType.hpp"
25// clang-format on
26
27//
28// Proxy lists are list types that may contain a list of proxy value which share the same type.
29//
30class WSF_PARSER_EXPORT WsfPProxyListType;
31
32// This is an instance of a proxy list
33class WSF_PARSER_EXPORT WsfPProxyList
34{
35public:
36 WsfPProxyList(const WsfPProxyListType* aTypePtr);
39 void PushBack();
40 void PushBack(WsfPProxyValue aValue);
41 void PopBack();
42 void Insert(WsfPProxyValue aValue, size_t aIndex);
43 void Remove(size_t aIndex);
44 WsfPProxyValue RemoveNoErase(size_t aIndex);
46 WsfPProxyValue Get(size_t aIndex);
47 bool Set(size_t aIndex, WsfPProxyValue aValue);
48 size_t Size();
49 void Clear();
50 size_t MemoryUsage() const;
51 // The proxy type for this list
53 // The list of values
54 std::vector<void*> mValues;
57 char mFiller[3];
59};
60
61// The proxy type class for the proxy list for a particular type
62class WSF_PARSER_EXPORT WsfPProxyListType : public WsfPProxyType
63{
64public:
65 WsfPProxyListType(WsfPProxyType* aDataTypePtr);
66
67 void Construct(void* aValuePtr) const override;
68
69 void Destroy(void* aValuePtr) const override;
70
71 void Copy(void* dest, void* src, int flags) const override;
72
73 bool IsUnset(void* aValuePtr) const override;
74
75 void SetUnset(void* aValuePtr) const override;
76
77 bool IsInherited(void* aValuePtr) const override;
78
79 void SetInherited(void* aValuePtr, bool aIsInherited) const override;
80
81 WsfPProxyValue GetAtIndex(void* aPtr, size_t aIndex) const override;
82 size_t GetAttrCount(void* aPtr) const override;
83 WsfPProxyType* GetDataType() const { return mTypePtr; }
84 WsfPProxyType* GetContainedType(size_t aIndex) const override;
85
86 WsfPProxyValue GetAttr(void*, const std::string&) const override { return WsfPProxyValue(); }
87 bool SwapAttr(void* aPtr, const WsfPProxyKey& aKey, WsfPProxyValue& aValue) const override;
88 // virtual WsfPProxyHash Hash(void* aDataPtr) const;
89 size_t MemoryUsage(void* aDataPtr) const override;
90
91private:
92 // The type of values the list contains
93 WsfPProxyType* mTypePtr;
94};
95#endif
class WSF_PARSER_EXPORT WsfPProxyListType
Definition WsfPProxyList.hpp:30
@ cMDB_PROXY_LIST
Definition WsfParseDebugMarkers.hpp:21
Definition WsfPProxyKey.hpp:24
Definition WsfPProxyList.hpp:63
void Construct(void *aValuePtr) const override
Definition WsfPProxyList.cpp:135
bool IsUnset(void *aValuePtr) const override
Definition WsfPProxyList.cpp:189
void SetUnset(void *aValuePtr) const override
Definition WsfPProxyList.cpp:195
WsfPProxyValue GetAttr(void *, const std::string &) const override
Definition WsfPProxyList.hpp:86
WsfPProxyListType(WsfPProxyType *aDataTypePtr)
Definition WsfPProxyList.cpp:182
WsfPProxyType * GetDataType() const
Definition WsfPProxyList.hpp:83
void Destroy(void *aValuePtr) const override
Definition WsfPProxyList.cpp:140
WsfPProxyValue GetAtIndex(void *aPtr, size_t aIndex) const override
Definition WsfPProxyList.cpp:146
void SetInherited(void *aValuePtr, bool aIsInherited) const override
Definition WsfPProxyList.cpp:207
bool IsInherited(void *aValuePtr) const override
Definition WsfPProxyList.cpp:201
size_t GetAttrCount(void *aPtr) const override
Definition WsfPProxyList.cpp:250
void Copy(void *dest, void *src, int flags) const override
Definition WsfPProxyList.cpp:152
WsfPProxyValue RemoveNoErase(size_t aIndex)
Definition WsfPProxyList.cpp:49
void PushBack()
Definition WsfPProxyList.cpp:30
void Insert(WsfPProxyValue aValue, size_t aIndex)
Definition WsfPProxyList.cpp:38
bool mIsInherited
Definition WsfPProxyList.hpp:55
bool Set(size_t aIndex, WsfPProxyValue aValue)
Definition WsfPProxyList.cpp:84
std::vector< void * > mValues
Definition WsfPProxyList.hpp:54
bool mIsDeleted
Definition WsfPProxyList.hpp:56
size_t MemoryUsage() const
Definition WsfPProxyList.cpp:124
UT_MEMORY_DEBUG_MARKER(cMDB_PROXY_LIST)
WsfPProxyType * GetDataType() const
Definition WsfPProxyList.cpp:102
size_t Size()
Definition WsfPProxyList.cpp:25
void Remove(size_t aIndex)
Definition WsfPProxyList.cpp:43
const WsfPProxyListType * mListTypePtr
Definition WsfPProxyList.hpp:52
WsfPProxyList(const WsfPProxyListType *aTypePtr)
Definition WsfPProxyList.cpp:17
void Clear()
Definition WsfPProxyList.cpp:107
WsfPProxyValue Back()
Definition WsfPProxyList.cpp:97
char mFiller[3]
Definition WsfPProxyList.hpp:57
void PopBack()
Definition WsfPProxyList.cpp:57
WsfPProxyValue Get(size_t aIndex)
Definition WsfPProxyList.cpp:67
Definition WsfPProxyType.hpp:37
WsfPProxyType(WsfProxy::ValueKind aKind)
Definition WsfPProxyType.hpp:39
Definition WsfPProxyValue.hpp:33
Copyrights Multiple, All Rights Reserved