From cba254d0bc7d09a7cd5ef87e1f69c9db37cb79b8 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 26 Jun 2014 20:06:04 +0000 Subject: [PATCH] Add wstring type handle. Also add some useful MAKE_SEQs. --- dtool/src/dtoolbase/register_type.cxx | 4 ++-- dtool/src/dtoolbase/register_type.h | 6 ++++++ dtool/src/dtoolbase/typeRegistry.h | 2 ++ dtool/src/prc/configVariableCore.h | 4 ++++ dtool/src/prc/configVariableManager.h | 1 + 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dtool/src/dtoolbase/register_type.cxx b/dtool/src/dtoolbase/register_type.cxx index 719bb8e29d..1eff1fa75e 100644 --- a/dtool/src/dtoolbase/register_type.cxx +++ b/dtool/src/dtoolbase/register_type.cxx @@ -26,6 +26,7 @@ TypeHandle bool_type_handle; TypeHandle double_type_handle; TypeHandle float_type_handle; TypeHandle string_type_handle; +TypeHandle wstring_type_handle; TypeHandle long_p_type_handle; TypeHandle int_p_type_handle; @@ -58,6 +59,7 @@ void init_system_type_handles() { register_type(double_type_handle, "double"); register_type(float_type_handle, "float"); register_type(string_type_handle, "string"); + register_type(wstring_type_handle, "wstring"); register_type(int_p_type_handle, "int*"); register_type(short_p_type_handle, "short*"); @@ -75,5 +77,3 @@ void init_system_type_handles() { register_type(pset_type_handle, "pset"); } } - - diff --git a/dtool/src/dtoolbase/register_type.h b/dtool/src/dtoolbase/register_type.h index 9428d1d235..e7b6a252ee 100644 --- a/dtool/src/dtoolbase/register_type.h +++ b/dtool/src/dtoolbase/register_type.h @@ -92,6 +92,7 @@ extern TypeHandle EXPCL_DTOOL bool_type_handle; extern TypeHandle EXPCL_DTOOL double_type_handle; extern TypeHandle EXPCL_DTOOL float_type_handle; extern TypeHandle EXPCL_DTOOL string_type_handle; +extern TypeHandle EXPCL_DTOOL wstring_type_handle; extern TypeHandle long_p_type_handle; extern TypeHandle int_p_type_handle; @@ -175,6 +176,11 @@ INLINE TypeHandle _get_type_handle(const string *) { return string_type_handle; } +template<> +INLINE TypeHandle _get_type_handle(const wstring *) { + return wstring_type_handle; +} + template<> INLINE TypeHandle _get_type_handle(const long * const *) { return long_p_type_handle; diff --git a/dtool/src/dtoolbase/typeRegistry.h b/dtool/src/dtoolbase/typeRegistry.h index 3a54961819..10efa40cad 100644 --- a/dtool/src/dtoolbase/typeRegistry.h +++ b/dtool/src/dtoolbase/typeRegistry.h @@ -58,9 +58,11 @@ PUBLISHED: int get_num_typehandles(); TypeHandle get_typehandle(int n); + MAKE_SEQ(get_typehandles, get_num_typehandles, get_typehandle); int get_num_root_classes(); TypeHandle get_root_class(int n); + MAKE_SEQ(get_root_classes, get_num_root_classes, get_root_class); int get_num_parent_classes(TypeHandle child, TypedObject *child_object) const; diff --git a/dtool/src/prc/configVariableCore.h b/dtool/src/prc/configVariableCore.h index 6ca5ab3665..96cf536c8f 100644 --- a/dtool/src/prc/configVariableCore.h +++ b/dtool/src/prc/configVariableCore.h @@ -66,15 +66,19 @@ PUBLISHED: bool has_value() const; int get_num_declarations() const; const ConfigDeclaration *get_declaration(int n) const; + MAKE_SEQ(get_declarations, get_num_declarations, get_declaration); INLINE int get_num_references() const; INLINE const ConfigDeclaration *get_reference(int n) const; + MAKE_SEQ(get_references, get_num_references, get_reference); INLINE int get_num_trusted_references() const; INLINE const ConfigDeclaration *get_trusted_reference(int n) const; + MAKE_SEQ(get_trusted_references, get_num_trusted_references, get_trusted_reference); INLINE int get_num_unique_references() const; INLINE const ConfigDeclaration *get_unique_reference(int n) const; + MAKE_SEQ(get_unique_references, get_num_unique_references, get_unique_reference); void output(ostream &out) const; void write(ostream &out) const; diff --git a/dtool/src/prc/configVariableManager.h b/dtool/src/prc/configVariableManager.h index 9448287e39..9ac9c18250 100644 --- a/dtool/src/prc/configVariableManager.h +++ b/dtool/src/prc/configVariableManager.h @@ -47,6 +47,7 @@ PUBLISHED: INLINE int get_num_variables() const; INLINE ConfigVariableCore *get_variable(int n) const; + MAKE_SEQ(get_variables, get_num_variables, get_variable); string get_variable_name(int n) const; bool is_variable_used(int n) const;