2016-08-08 09:45:00 -06:00
|
|
|
#include <stddef.h>
|
2012-03-19 06:59:11 -06:00
|
|
|
|
2023-05-28 23:12:35 -06:00
|
|
|
#include <condition_variable>
|
2018-07-07 04:27:29 -06:00
|
|
|
#include <fstream>
|
2023-05-28 11:21:49 -06:00
|
|
|
#include <mutex>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2012-03-19 06:59:11 -06:00
|
|
|
|
2012-03-25 04:06:05 -06:00
|
|
|
#include "DataFuncs.h"
|
2023-05-28 23:12:35 -06:00
|
|
|
#include "DataIdentity.h"
|
2012-03-19 06:59:11 -06:00
|
|
|
|
2023-08-04 19:00:29 -06:00
|
|
|
// the space after the uses of "type" in OPAQUE_IDENTITY_TRAITS_NAME is _required_
|
|
|
|
// without it the macro generates a syntax error when type is a template specification
|
|
|
|
|
2012-03-19 10:12:27 -06:00
|
|
|
namespace df {
|
2016-08-10 21:58:45 -06:00
|
|
|
#define NUMBER_IDENTITY_TRAITS(category, type, name) \
|
|
|
|
category##_identity<type> identity_traits<type>::identity(name);
|
|
|
|
#define INTEGER_IDENTITY_TRAITS(type, name) NUMBER_IDENTITY_TRAITS(integer, type, name)
|
|
|
|
#define FLOAT_IDENTITY_TRAITS(type) NUMBER_IDENTITY_TRAITS(float, type, #type)
|
2023-05-28 11:07:21 -06:00
|
|
|
#define OPAQUE_IDENTITY_TRAITS_NAME(type, name) \
|
2023-08-04 19:00:29 -06:00
|
|
|
opaque_identity identity_traits<type >::identity(sizeof(type), allocator_noassign_fn<type >, name)
|
2023-05-28 11:07:21 -06:00
|
|
|
#define STL_OPAQUE_IDENTITY_TRAITS(type) OPAQUE_IDENTITY_TRAITS_NAME(std::type, #type)
|
2012-03-20 03:56:29 -06:00
|
|
|
|
2016-08-10 21:58:45 -06:00
|
|
|
INTEGER_IDENTITY_TRAITS(char, "char");
|
|
|
|
INTEGER_IDENTITY_TRAITS(signed char, "int8_t");
|
|
|
|
INTEGER_IDENTITY_TRAITS(unsigned char, "uint8_t");
|
|
|
|
INTEGER_IDENTITY_TRAITS(short, "int16_t");
|
|
|
|
INTEGER_IDENTITY_TRAITS(unsigned short, "uint16_t");
|
|
|
|
INTEGER_IDENTITY_TRAITS(int, "int32_t");
|
|
|
|
INTEGER_IDENTITY_TRAITS(unsigned int, "uint32_t");
|
|
|
|
INTEGER_IDENTITY_TRAITS(long, "long");
|
|
|
|
INTEGER_IDENTITY_TRAITS(unsigned long, "unsigned long");
|
|
|
|
INTEGER_IDENTITY_TRAITS(long long, "int64_t");
|
|
|
|
INTEGER_IDENTITY_TRAITS(unsigned long long, "uint64_t");
|
2016-07-28 14:36:02 -06:00
|
|
|
FLOAT_IDENTITY_TRAITS(float);
|
|
|
|
FLOAT_IDENTITY_TRAITS(double);
|
2012-03-20 03:56:29 -06:00
|
|
|
|
|
|
|
bool_identity identity_traits<bool>::identity;
|
|
|
|
stl_string_identity identity_traits<std::string>::identity;
|
2012-03-25 09:12:59 -06:00
|
|
|
ptr_string_identity identity_traits<char*>::identity;
|
|
|
|
ptr_string_identity identity_traits<const char*>::identity;
|
2012-03-20 03:56:29 -06:00
|
|
|
pointer_identity identity_traits<void*>::identity;
|
|
|
|
stl_ptr_vector_identity identity_traits<std::vector<void*> >::identity;
|
2012-03-21 03:26:53 -06:00
|
|
|
stl_bit_vector_identity identity_traits<std::vector<bool> >::identity;
|
2012-03-29 12:56:06 -06:00
|
|
|
bit_array_identity identity_traits<BitArray<int> >::identity;
|
2012-03-21 03:26:53 -06:00
|
|
|
|
2023-05-28 23:09:59 -06:00
|
|
|
STL_OPAQUE_IDENTITY_TRAITS(condition_variable);
|
2023-05-28 11:07:21 -06:00
|
|
|
STL_OPAQUE_IDENTITY_TRAITS(fstream);
|
|
|
|
STL_OPAQUE_IDENTITY_TRAITS(mutex);
|
2023-08-04 19:00:29 -06:00
|
|
|
STL_OPAQUE_IDENTITY_TRAITS(future<void>);
|
2023-09-12 20:55:55 -06:00
|
|
|
STL_OPAQUE_IDENTITY_TRAITS(function<void()>);
|
|
|
|
STL_OPAQUE_IDENTITY_TRAITS(optional<std::function<void()> >);
|
2014-09-24 12:47:04 -06:00
|
|
|
|
2012-03-21 03:26:53 -06:00
|
|
|
buffer_container_identity buffer_container_identity::base_instance;
|
2012-03-19 10:12:27 -06:00
|
|
|
}
|