cgv
Loading...
Searching...
No Matches
binary_io_reflection_handlers.h
1#pragma once
2
3#include <stdio.h>
4#include "io_reflection_handler.h"
5
6#include "lib_begin.h"
7
8namespace cgv {
9 namespace data {
10
11
13class CGV_API binary_reflection_handler : public io_reflection_handler
14{
15protected:
16 FILE* fp;
17public:
19 binary_reflection_handler(const std::string& _content, unsigned _ver);
21 bool reflect_header();
23 void close();
24};
25
27class CGV_API binary_read_reflection_handler : public binary_reflection_handler
28{
29protected:
30 bool read_reflect_header(const std::string& _content, unsigned _ver);
31public:
32 binary_read_reflection_handler(const std::string& file_name, const std::string& _content, unsigned _ver);
34 binary_read_reflection_handler(FILE* _fp, const std::string& _content, unsigned _ver);
36 bool is_creative() const;
38 bool reflect_member_void(const std::string& member_name,
39 void* member_ptr, cgv::reflect::abst_reflection_traits* rt);
40};
41
42
44class CGV_API binary_write_reflection_handler : public binary_reflection_handler
45{
46public:
48 binary_write_reflection_handler(const std::string& file_name, const std::string& _content, unsigned _ver);
50 binary_write_reflection_handler(FILE* _fp, const std::string& _content, unsigned _ver);
52 bool reflect_member_void(const std::string& member_name,
53 void* member_ptr, cgv::reflect::abst_reflection_traits* rt);
54};
55
56
57 }
58}
59
60#include <cgv/config/lib_end.h>
bool reflect_member_void(const std::string &member_name, void *member_ptr, cgv::reflect::abst_reflection_traits *rt)
abstract interface to reflect a member variable, where the member type is specified as a string.
binary_write_reflection_handler(const std::string &file_name, const std::string &_content, unsigned _ver)
construct from file_name by opening file in ascii mode
bool reflect_member_void(const std::string &member_name, void *member_ptr, cgv::reflect::abst_reflection_traits *rt)
abstract interface to reflect a member variable, where the member type is specified as a string.
namespace for data management components
this header is dependency free
Definition print.h:11
abstract interface for type reflection with basic type management and optional string conversion