Teamcenter C++ API Reference  2312
FeatureKeyCheck.hxx
Go to the documentation of this file.
1 /*=============================================================================
2  Copyright (c) 1992 Electronic Data Systems Corporation
3 
4  Unpublished - All rights reserved
5  THIS PROGRAM IS AN UNPUBLISHED WORK FULLY PROTECTED BY THE UNITED STATES
6  COPYRIGHT LAWS AND IS CONSIDERED A TRADE SECRET BELONGING TO THE COPYRIGHT
7  HOLDER.
8 ===============================================================================
9 File description:
10 
11 
12  FILE : FeatureKeyCheck.hxx
13  MODULE: TCCORE
14 
15  These classes provide simple logical support for UGS common licensing check.
16  License checks can, for example, take the following format.
17 
18  CHANGE_USER OR (CHANGE_AUTHOR AND CHANGE_ACCESS)
19 
20 ====================================================================================================
21  Date Name Description of Change
22 
23 $HISTORY$
24 ===================================================================================================*/
25 
26 #ifndef TEAMCENTER__FEATUREKEYCHECK_HXX
27 #define TEAMCENTER__FEATUREKEYCHECK_HXX
28 
29 #include <vector>
30 #include <string>
31 #include <tccore/libtccore_exports.h>
32 
33 namespace Teamcenter
34 {
35  class FeatureKeyCheck;
36  class FeatureKeyCheckAND;
37  class FeatureKeyCheckOR;
38 }
39 
40 class TCCORE_API Teamcenter::FeatureKeyCheck
41 {
42 public:
44  explicit FeatureKeyCheck(std::string featureKeyStr);
45  virtual ~FeatureKeyCheck();
46 
47  int getFeatureKey(std::string &featureKeyStr);
48 
49  virtual int toString(std::string &str);
50 
51  virtual int evaluate(const std::string &BOName, int &result, bool &fullCheck);
52  virtual int evaluateFirst(const std::string &BOName, int &result);
53 
54 protected:
55  std::string featureKey;
56 };
57 
58 class TCCORE_API Teamcenter::FeatureKeyCheckAND : public Teamcenter::FeatureKeyCheck
59 {
60 public:
62  FeatureKeyCheckAND(FeatureKeyCheck *keyChecks[], int numChecks);
63  FeatureKeyCheckAND(std::string keyChecks[], int numChecks);
65 
66  int getNumKeys(int *num);
67 
68  int toString(std::string &str);
69 
70  int evaluate(const std::string &BOName, int &result, bool &fullCheck);
71  int evaluateFirst(const std::string &BOName, int &result);
72 
73 private:
74  std::vector<FeatureKeyCheck *> featureKeyChecks;
75  int count;
76 };
77 
78 class TCCORE_API Teamcenter::FeatureKeyCheckOR : public Teamcenter::FeatureKeyCheck
79 {
80 public:
82  FeatureKeyCheckOR(FeatureKeyCheck *keyChecks[], int numChecks);
83  FeatureKeyCheckOR(std::string keyChecks[], int numChecks);
85 
86  int getNumKeys(int *num);
87 
88  int toString(std::string &str);
89  int toMsgString(std::string &str);
90 
91  int evaluate(const std::string &BOName, int &result, bool &fullCheck);
92  int evaluateFirst(const std::string &BOName, int &result);
93 
94 private:
95  std::vector<FeatureKeyCheck *> featureKeyChecks;
96  int count;
97 };
98 
99 #include <tccore/libtccore_undef.h>
100 #endif