6#include <system/shared_ptr.h>
7#include <system/reflection/binding_flags.h>
8#include <system/reflection.h>
21namespace System {
namespace Reflection {
class MemberInfo; }}
22namespace System {
namespace Reflection {
class MethodInfo; }}
23namespace System {
namespace Reflection {
class PropertyInfo; } }
24namespace System {
namespace Reflection {
class ConstructorInfo; }}
25namespace System {
namespace Reflection {
class FieldInfo; } }
43 static void Hash(uint32_t &hash,
int strLen,
const char_t *input)
45 hash = input[strLen - i] + (hash << 6) + (hash << 16) - hash;
53class StringHashCompiletime<0>
57 static void Hash(uint32_t &hash,
int strLen,
const char_t* input)
60 ASPOSE_UNUSED(strLen);
74 std::unique_ptr<TypeInfo>
ptr;
91 ASPOSECPP_SHARED_API
TypeInfoPtr(
const char_t* name, uint32_t hash);
110 friend class TypeInfoImpl;
113 typedef const TypeInfo& (*GetTypeInfoFunPtr)();
115 std::shared_ptr<TypeInfoImpl> m_pimpl;
116 TypeInfoImpl *getPipml()
const;
127 while (char_t c = *str++)
128 hash = c + (hash << 6) + (hash << 16) - hash;
143 ASPOSECPP_SHARED_API
TypeInfo(
const char_t* name, uint32_t hash);
146 ASPOSECPP_SHARED_API
TypeInfo(
const std::type_info& info);
232 ASPOSECPP_SHARED_API uint32_t
Hash()
const;
242 return *
this == other;
250 if (*
this ==
nullptr && info ==
nullptr)
255 if (*
this ==
nullptr || info ==
nullptr)
260 return Hash() == info.
Hash();
333 ASPOSECPP_SHARED_API
void SetBaseType(GetTypeInfoFunPtr basetype);
345 template <
class T>
inline void AddDefaultConstructor();
362 return *System::static_holder<TypeInfo::BoxedValue<T>>();
403struct hash<
System::TypeInfo> {
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
A helper class that generates a hash value from a c-string.
Definition: type_info.h:37
static void Hash(uint32_t &hash, int strLen, const char_t *input)
Generates a hash value from the specified c-string of the specified length.
Definition: type_info.h:43
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Represents a particular type and provides information about it.
Definition: type_info.h:109
String ToString() const
Returns a string containing the name of the type represented by the current object.
ArrayPtr< SharedPtr< System::Reflection::PropertyInfo > > GetProperties(System::Reflection::BindingFlags bindingAttr) const
Searches for the properties of the current Type, using the specified binding constraints.
bool get_IsValueType() const
Gets a value indicating whether the Type is a value type.
System::SharedPtr< System::Reflection::Assembly > get_Assembly() const
NOT IMPLEMENTED. Returns a pointer to the assembly in which the type represented by the current objec...
bool get_IsSealed() const
Gets a value indicating whether the Type is declared sealed.
bool IsInstanceOfType(const SharedPtr< Object > &obj) const
Determines whether the specified object is an instance of the current type.
TypeInfo(const char_t *name, uint32_t hash)
Constructor.
SharedPtr< System::Reflection::FieldInfo > GetField(const System::String &name, System::Reflection::BindingFlags bindingAttr) const
Searches for the specified field, using the specified binding constraints.
static TypeInfo EmptyType
Constant representing empty list of TypeInfo.
Definition: type_info.h:378
String get_Namespace() const
Gets the namespace of the Type.
bool get_IsClass() const
Gets a value indicating whether the Type is a class or a delegate; that is, not a value type or inter...
String get_FullName() const
Returns the fully qualified name (but without the assembly name) of the type represented by the curre...
static const TypeInfo & BoxedValueType()
Provides unique TypeInfo structure for BoxedValue type to be shared by multiple Boxed* classes.
Definition: type_info.h:360
void reset()
Sets TypeInfo to null.
bool get_IsArray() const
Gets a value that indicates whether the type is an array.
ArrayPtr< ObjectPtr > GetCustomAttributes(const TypeInfo &attributeType, bool inherit) const
Returns an array containing objects that represent specific attributes applied to the type.
TypeInfo()
Default constructor (no type is set).
String get_AssemblyQualifiedName() const
NOT IMPLEMENTED. Returns the fully qualified name including the assembly name of the type represented...
bool get_IsAbstract() const
Gets a value indicating whether the Type is abstract and must be overridden.
bool get_IsGenericTypeDefinition() const
Gets a value indicating whether the current Type represents a generic type definition,...
static uint32_t StringHash(const char_t *str)
Calculates hash for specified string.
Definition: type_info.h:123
void set_IsValueType(bool value)
Sets a value indicating whether the Type is a value type.
bool get_IsGenericType() const
String get_Name() const
Returns the name of the type represented by the current object.
void AddAttribute(const ObjectPtr &attribute)
Adds the specified attribute to the list of type's attributes.
ArrayPtr< SharedPtr< System::Reflection::MemberInfo > > get_DeclaredMember(const String &name) const
Gets list of the members with specified name.
ArrayPtr< SharedPtr< System::Reflection::MemberInfo > > GetMember(const String &name) const
Gets list of the members with specified name.
void SetTemplParamType(const TypeInfo &templParam)
Sets template parameter type descritor.
void AddDefaultConstructor(DefaultConstructor method)
Sets default constructor by the functor that creates class instanse.
bool IsAssignableFrom(const TypeInfo &type) const
Determines whether an instance of a specified type can be assigned to a variable of the current type.
ObjectPtr GetCustomAttribute(const TypeInfo &attributeType) const
Searches for the custom attribute applied having the specified type and applied to the type reprsente...
static ArrayPtr< TypeInfo > EmptyTypes
Constant representing empty list of TypeInfo.
Definition: type_info.h:375
SharedPtr< System::Reflection::ConstructorInfo > GetConstructor(const ArrayPtr< TypeInfo > &types) const
Searches for a public instance constructor whose parameters match the types in the specified array.
uint32_t Hash() const
Returns a hash value associated with the type represented by the current object.
std::function< ObjectPtr()> DefaultConstructor
Function pointer to construct type.
Definition: type_info.h:348
bool get_ContainsGenericParameters() const
Gets a value indicating whether the current Type object has type parameters that have not been replac...
bool get_IsEnum() const
Gets a value indicating whether the current Type represents an enumeration.
bool Equals(const TypeInfo &other) const
Definition: type_info.h:240
ArrayPtr< TypeInfo > GetInterfaces() const
Gets all the interfaces implemented or inherited by the current Type.
TypeInfo(const std::type_info &info)
Constructor.
static const TypeInfo & Type()
Returns a TypeInfo object that represent TypeInfo class.
ArrayPtr< ObjectPtr > GetCustomAttributes() const
Returns an array containing objects that represent all custom attributes applied to the type.
int GetHashCode() const
Returns a hash code associated with this instance.
Definition: type_info.h:235
bool IsSubclassOf(const TypeInfo &type) const
Determines whether the type represented by the current object is a subclass of the specified class.
TypeInfo(const char_t *name)
Constructor.
ArrayPtr< TypeInfo > GetGenericArguments() const
Gets an array of the generic type arguments for this type.
SharedPtr< System::Reflection::MethodInfo > GetMethod(const String &name) const
Gets method with specified name.
TypeInfo get_BaseType() const
Returns base type descritor.
ArrayPtr< SharedPtr< System::Reflection::ConstructorInfo > > GetConstructors(System::Reflection::BindingFlags bindingAttr) const
searches for the constructors defined for the current Type, using the specified BindingFlags.
TypeInfo(std::nullptr_t)
Null object constructor (no type is set).
void AddMember(const SharedPtr< System::Reflection::MemberInfo > &member)
Adds the specified member to the list of type's members.
ArrayPtr< SharedPtr< System::Reflection::PropertyInfo > > GetProperties() const
Returns all the public properties of the current Type.
bool IsDefined(const TypeInfo &attributeType, bool inherit) const
NOT IMPLEMENTED. Indicates whether one or more attributes of the specified type or of its derived typ...
bool get_IsVisible() const
Gets a value indicating whether the Type can be accessed by code outside the assembly.
TypeInfo GetElementType() const
NOT IMPLEMENTED.
ArrayPtr< TypeInfo > get_GenericTypeArguments() const
Gets an array of the generic type arguments for this type.
bool get_IsInterface() const
Gets a value indicating whether the Type is an interface; that is, not a class or a value type.
ArrayPtr< SharedPtr< System::Reflection::ConstructorInfo > > GetConstructors() const
Returns all the public constructors defined for the current Type.
TypeInfo GetTemplParamType() const
Gets template parameter type descritor.
void SetBaseType(GetTypeInfoFunPtr basetype)
Sets base type descritor.
ArrayPtr< SharedPtr< System::Reflection::FieldInfo > > GetFields(System::Reflection::BindingFlags bindingAttr) const
Searches for the fields defined for the current Type, using the specified binding constraints.
BindingFlags
Degines members and types lookup modes and bindings.
Definition: binding_flags.h:10
@ Assembly
Assembly-scoped members.
@ TypeInfo
Specifies that the member is a type.
Definition: db_command.h:9
bool operator!=(ArraySegment< T > a, ArraySegment< T > b)
Definition: array_segment.h:157
std::ostream & operator<<(std::ostream &stream, DateTime date_time)
Insert data into the stream using UTF-8 encoding.
Definition: date_time.h:729
bool operator==(ArraySegment< T > a, ArraySegment< T > b)
Definition: array_segment.h:151
TypeInfo structure for BoxedValue class.
Definition: type_info.h:367
BoxedValue()
Fills appropriate type name.
Definition: type_info.h:369
Wrapper for a pointer to an instance of TypeInfo class. This type should be allocated on stack and pa...
Definition: type_info.h:72
TypeInfoPtr(const char_t *name)
Constructor.
TypeInfoPtr(const String &name)
Constructor.
~TypeInfoPtr()
Destructor.
std::unique_ptr< TypeInfo > ptr
Unique pointer to the TypeInfo object.
Definition: type_info.h:74
TypeInfoPtr(const char_t *name, uint32_t hash)
Constructor.
TypeInfoPtr()=default
Default constructor.
TypeInfoPtr(const std::type_info &info)
Constructor.