cgv
Loading...
Searching...
No Matches
io_reflection_handler.h
1#pragma once
2
3#include <fstream>
4#include <cgv/reflect/reflection_handler.h>
5#include <cgv/reflect/reflect_enum.h>
6
7#include "lib_begin.h"
8
9namespace cgv {
10 namespace data {
11
13enum IOReflectionError { RE_NO_ERROR, RE_FILE_OPEN_ERROR, RE_FILE_READ_ERROR, RE_FILE_WRITE_ERROR, RE_CONTENT_MISMATCH, RE_VERSION_MISMATCH };
14
15extern CGV_API cgv::reflect::enum_reflection_traits<IOReflectionError> get_reflection_traits(const IOReflectionError&);
16
19{
20public:
21protected:
22 unsigned version;
23 std::string file_content;
24
25 bool in_header;
26 IOReflectionError last_error;
27public:
29 io_reflection_handler(const std::string& _content, unsigned _ver);
31 bool failed() const;
33 IOReflectionError get_error_code() const;
35 static std::string get_error_message(IOReflectionError ae);
37 bool reflect_method_void(const std::string& method_name, cgv::reflect::method_interface* mi_ptr,
38 cgv::reflect::abst_reflection_traits* return_traits, const std::vector<cgv::reflect::abst_reflection_traits*>& param_value_traits);
39};
40
41
42 }
43}
44
45#include <cgv/config/lib_end.h>
common base for all io reflection handlers
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
IOReflectionError
different error codes
the cgv namespace
Definition print.h:11
abstract interface for type reflection with basic type management and optional string conversion
this type specific reflection traits class is used by the reflect_enum function to reflect enum types
abstract interface to call a method of a given instance.