CodeSonar C++ API
[For improved navigation, enable JavaScript.]
Namespaces
cs_enum_boilerplate.hpp File Reference

Go to the source code of this file.

Namespaces

 cs
 Namespace for CodeSonar/CodeSurfer API.
 

Macros

#define CS_ENUM_BOILERPLATE(cls, CTYPE, getname, is_valid)
 
#define CS_ENUM_BOILERPLATE_FRIENDS(cls, friends, cs)
 
#define CS_ENUM_BOILERPLATE_FRIENDS_NO_CGLUE(cls)
 
#define CS_ENUM_BOILERPLATE_NONAME(cls, CTYPE, is_valid)
 
#define CS_ENUM_BOILERPLATE_NONAME_NOCTOR(cls, CTYPE)
 
#define CS_ENUM_BOILERPLATE_NONMEMBERS(cls, cs)
 
#define CS_ENUM_BOILERPLATE_UB(cls, CTYPE, getname, ub)   CS_ENUM_BOILERPLATE(cls, CTYPE, getname, ((csuint64)_inner) < ((csuint64)ub))
 
#define CS_ENUM_BOILERPLATE_UB_NZ(cls, CTYPE, getname, ub)   CS_ENUM_BOILERPLATE(cls, CTYPE, getname, _inner && ((csuint64)_inner) < ((csuint64)ub))
 
#define CS_FLAGS_BOILERPLATE(cls, CTYPE, mask, ...)
 
#define CS_FLAGS_BOILERPLATE_FRIENDS(cls, friends, cs)
 

Macro Definition Documentation

◆ CS_ENUM_BOILERPLATE

#define CS_ENUM_BOILERPLATE (   cls,
  CTYPE,
  getname,
  is_valid 
)
Value:
private: \ \
cls(); \
CS_ENUM_BOILERPLATE_NONAME(cls, CTYPE, is_valid) \ \ \
std::string name() const \
{ \
const char *rv; \
getname; \
return rv; \
} \
\

◆ CS_ENUM_BOILERPLATE_FRIENDS

#define CS_ENUM_BOILERPLATE_FRIENDS (   cls,
  friends,
  cs 
)
Value:
CS_ENUM_BOILERPLATE_FRIENDS_NO_CGLUE(cls) \
template <> \
class cglue<cls> \
{ \
friends \
cglue(); \
public: \
typedef cls::ctype ctype; \
typedef cls type; \
CS_CXX_API_CGLUE_ACCESS_MODIFIER: \
static type wrap(const ctype &c) \
{ return type(c); } \
static ctype unwrap(const type &c) \
{ return c.unwrap(); } \
}; \
CS_ENUM_BOILERPLATE_NONMEMBERS(cls, cs)
Namespace for CodeSonar/CodeSurfer API.
Definition: cs_ast.hpp:33

◆ CS_ENUM_BOILERPLATE_NONAME

#define CS_ENUM_BOILERPLATE_NONAME (   cls,
  CTYPE,
  is_valid 
)
Value:
CS_ENUM_BOILERPLATE_NONAME_NOCTOR(cls, CTYPE) \ \ \ \ \
static cls from_integer(csint64 _inner) \
{ \
if( !(is_valid) ) \
cs::check(CS_ERROR_INVALID_ARGUMENT); \
return cls((ctype)_inner); \
} \
private: \
cls(ctype _inner_ct): inner(_inner_ct) \
{ \
csuint64 _inner = _inner_ct; \
(void)_inner; \
assert( is_valid ); \
} \
public: \

◆ CS_ENUM_BOILERPLATE_NONMEMBERS

#define CS_ENUM_BOILERPLATE_NONMEMBERS (   cls,
  cs 
)
Value:
\ \ \ \ \
inline std::ostream &operator<<( std::ostream &out, const cls &a ) \
{ \
return out << "cs" CS_AS_REPR_SCOPE #cls " " \
<< a.name(); \
} \
CS_STD_HASH(cls, cs)
Namespace for CodeSonar/CodeSurfer API.
Definition: cs_ast.hpp:33
std::ostream & operator<<(std::ostream &out, const ast_family &a)
Print a representation of a ast_family object to the specified stream.
Definition: cs_ast_decl.hpp:67