WSF
WsfCategoryList.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#ifndef WSFCATEGORYLIST_HPP
13#define WSFCATEGORYLIST_HPP
14
15#include "wsf_export.h"
16
17#include <vector>
18
19class UtInput;
20#include "WsfStringId.hpp"
21
32
34{
35public:
36 typedef std::vector<WsfStringId> CategoryList;
37
39
41 void Clear() { mCategories.clear(); }
42
43 void JoinCategory(WsfStringId aCategoryId);
44
45 bool ProcessInput(UtInput& aInput);
46
47 bool IsCategoryMember(WsfStringId aCategoryId) const;
48
49 bool Intersects(const WsfCategoryList& aOtherList) const;
50
51 bool IsASubsetOf(const WsfCategoryList& aOtherList) const;
52
54 const CategoryList& GetCategoryList() const { return mCategories; }
55
56private:
57 // Using the default copy constructor, destructor and assignment operator.
58
59 // The set of categories to which the associated object belongs.
60 //
61 // Logically this should be a 'set', but most objects will only be a member of a few categories.
62 // In such a case, searching a 'vector' is faster than searching a set. Furthermore, sometimes
63 // it is desirable to know the order in which categories were added. A 'set' wont work there.
64
65 CategoryList mCategories;
66};
67
68#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Contains the 'categories' to which an object belongs.
Definition WsfCategoryList.hpp:34
std::vector< WsfStringId > CategoryList
Definition WsfCategoryList.hpp:36
void Clear()
Clears the category list.
Definition WsfCategoryList.hpp:41
WsfCategoryList()
Definition WsfCategoryList.cpp:21
const CategoryList & GetCategoryList() const
Return a the actual list.
Definition WsfCategoryList.hpp:54
Copyrights Multiple, All Rights Reserved