Classes | Namespaces | Macros | Functions
safe_numerics.h File Reference
#include <limits>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
Include dependency graph for safe_numerics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  google::protobuf::python::IsValidNumericCastImpl< SameSize, DestLarger, DestIsSigned, SourceIsSigned >
 

Namespaces

 google
 
 google::protobuf
 
 google::protobuf::python
 

Macros

#define BASE_NUMERIC_CAST_CASE_DEST_LARGER(DestSigned, SourceSigned, Code)
 
#define BASE_NUMERIC_CAST_CASE_SAME_SIZE(DestSigned, SourceSigned, Code)
 
#define BASE_NUMERIC_CAST_CASE_SOURCE_LARGER(DestSigned, SourceSigned, Code)
 
#define BASE_NUMERIC_CAST_CASE_SPECIALIZATION(A, B, C, D, Code)
 

Functions

 google::protobuf::python::BASE_NUMERIC_CAST_CASE_DEST_LARGER (false, false, true)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_DEST_LARGER (false, true, source >=0)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_DEST_LARGER (true, false, true)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_DEST_LARGER (true, true, true)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SAME_SIZE (false, false, true)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SAME_SIZE (false, true, source >=0)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SAME_SIZE (true, false, source<=static_cast< Source >(max))
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SAME_SIZE (true, true, true)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SOURCE_LARGER (false, false, source<=max)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SOURCE_LARGER (false, true, source >=0 &&source<=max)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SOURCE_LARGER (true, false, source<=static_cast< Source >(max))
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SOURCE_LARGER (true, true, source >=min &&source<=max)
 
template<class Dest , class Source >
Dest google::protobuf::python::checked_numeric_cast (Source source)
 
template<class Dest , class Source >
bool google::protobuf::python::IsValidNumericCast (Source source)
 

Macro Definition Documentation

◆ BASE_NUMERIC_CAST_CASE_DEST_LARGER

#define BASE_NUMERIC_CAST_CASE_DEST_LARGER (   DestSigned,
  SourceSigned,
  Code 
)
Value:
false, true, DestSigned, SourceSigned, Code); \

Definition at line 66 of file safe_numerics.h.

◆ BASE_NUMERIC_CAST_CASE_SAME_SIZE

#define BASE_NUMERIC_CAST_CASE_SAME_SIZE (   DestSigned,
  SourceSigned,
  Code 
)
Value:
true, true, DestSigned, SourceSigned, Code); \
BASE_NUMERIC_CAST_CASE_SPECIALIZATION( \
true, false, DestSigned, SourceSigned, Code)

Definition at line 56 of file safe_numerics.h.

◆ BASE_NUMERIC_CAST_CASE_SOURCE_LARGER

#define BASE_NUMERIC_CAST_CASE_SOURCE_LARGER (   DestSigned,
  SourceSigned,
  Code 
)
Value:
false, false, DestSigned, SourceSigned, Code); \

Definition at line 62 of file safe_numerics.h.

◆ BASE_NUMERIC_CAST_CASE_SPECIALIZATION

#define BASE_NUMERIC_CAST_CASE_SPECIALIZATION (   A,
  B,
  C,
  D,
  Code 
)
Value:
template <> struct IsValidNumericCastImpl<A, B, C, D> { \
template <class Source, class DestBounds> static inline bool Test( \
Source source, DestBounds min, DestBounds max) { \
return Code; \
} \
}

Definition at line 48 of file safe_numerics.h.

google::protobuf::util::error::Code
Code
Definition: status.h:46
BASE_NUMERIC_CAST_CASE_SPECIALIZATION
#define BASE_NUMERIC_CAST_CASE_SPECIALIZATION(A, B, C, D, Code)
Definition: safe_numerics.h:48
A
Definition: logging_striptest_main.cc:56
source
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:3072


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:04