CodeSonar C++ API
[For improved navigation, enable JavaScript.]
cs_int_pair_set_decl.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023, an unpublished work by CodeSecure, Inc.
3  * ALL RIGHTS RESERVED
4  *
5  * Copyright (c) 2013-2023, an unpublished work by GrammaTech, Inc.
6  * ALL RIGHTS RESERVED
7  *
8  * This software is furnished under a license and may be used and
9  * copied only in accordance with the terms of such license and the
10  * inclusion of the above copyright notice. This software or any
11  * other copies thereof may not be provided or otherwise made
12  * available to any other person. Title to and ownership of the
13  * software is retained by CodeSecure, Inc.
14  */
15 
16 #ifndef CS_INT_PAIR_SET_DECL_HPP
17 #define CS_INT_PAIR_SET_DECL_HPP
18 
19 #include "cs_int_pair_set.h"
20 #include "cs_set.hpp"
21 #include "cs_int_pair.hpp"
22 
25 #ifndef SWIG
26 namespace cs{
28  inline cs_result cs_int_pair_set_create_default(cs_int_pair_set *out_set)
29  {
30  return cs_int_pair_set_create(out_set);
31  }
32 
33  inline cs_result cs_int_pair_set_create(cs_set_kind k, cs_int_pair_set *out_set)
34  {
35  (void)k;
36  return cs_int_pair_set_create(out_set);
37  }
38 
39  inline cs_result cs_int_pair_set_put(
40  cs_int_pair_set l_int_pair_set,
41  cs_int_pair p)
42  {
43  return cs_int_pair_set_put(l_int_pair_set, p.int1, p.int2);
44  }
45 
46  inline cs_result cs_int_pair_set_delete(
47  cs_int_pair_set l_int_pair_set,
48  cs_int_pair p)
49  {
50  return cs_int_pair_set_delete(l_int_pair_set, p.int1, p.int2);
51  }
52 
53  inline cs_boolean cs_int_pair_set_member(
54  cs_int_pair_set l_int_pair_set,
55  cs_int_pair p)
56  {
57  return cs_int_pair_set_member(l_int_pair_set, p.int1, p.int2);
58  }
60 }
61 #endif
62 
63 #define CS_SET_IMPL_ID(name) cs_int_pair_ ## name
64 #define CS_SET_IMPL_KEY int_pair
65 #define CS_SET_IMPL_MUTABLE 2
66 #include "cs_set_impl.hpp"
67 
68 namespace cs{
69 
70 
71  template<>
72  class cglue<int_pair_set>
73  {
74  cglue();
75  friend class point;
76  friend class set_mixin<point_set>;
77  friend class set_mixin<mutable_set<int_pair> >;
78  public:
79  typedef cs_int_pair_set ctype;
80  typedef int_pair_set type;
81  CS_CXX_API_CGLUE_ACCESS_MODIFIER:
82  static type wrap(const ctype &c, bool frozen);
83  static ctype unwrap(const type &c);
84  };
85 
119  template<> class set_mixin<mutable_set<int_pair> >
120  {
121  cs_int_pair_set unwrap() const
122  { return cglue<int_pair_set>::unwrap(*static_cast<const int_pair_set*>(this)); }
123  protected:
124  set_mixin(){}
125  public:
126 
136  point_set to_point_set(sfileinst sfi) const;
137  };
138 
139  inline int_pair_set cglue<int_pair_set>::wrap(const cs_int_pair_set &c, bool frozen)
140  { return type(c, frozen); }
141 
142  inline cs_int_pair_set cglue<int_pair_set>::unwrap(const int_pair_set &c)
143  { return c.unwrap(); }
144 
145 }
146 
147 #endif /* CS_INT_PAIR_SET_DECL_HPP */
Namespace for CodeSonar/CodeSurfer API.
Definition: cs_ast.hpp:33
std::pair< csuint32, csuint32 > int_pair
A std::pair of integers, used to represent a range of locations in a compilation unit.
Definition: cs_tplt_instantiations.hpp:70