Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

ParameterRemapBasicStringToString Class Reference

Maps a concrete basic_string<char> to an atomic string. More...

#include <parameterRemapBasicStringToString.h>

Inheritance diagram for ParameterRemapBasicStringToString:

ParameterRemapToString ParameterRemap List of all members.

Public Member Functions

 ParameterRemapBasicStringToString (CPPType *orig_type)
virtual void pass_parameter (ostream &out, const string &variable_name)
 Outputs an expression that converts the indicated variable from the original type to the new type, for passing into the actual C++ function.

virtual string prepare_return_expr (ostream &out, int indent_level, const string &expression)
 This will be called immediately before get_return_expr().

virtual string get_return_expr (const string &expression)
 Returns an expression that evalutes to the appropriate value type for returning from the function, given an expression of the original type.

virtual bool new_type_is_atomic_string ()
 Returns true if the type represented by the conversion is now the atomic string type.

bool is_valid () const
CPPTypeget_orig_type () const
 Returns the type of the original, C++ parameter or return value.

CPPTypeget_new_type () const
 Returns the type of the wrapper's parameter or return value.

CPPTypeget_temporary_type () const
 Returns the type of any temporary variables used to hold the return value before returning it.

bool has_default_value () const
 Returns true if this particular parameter has a default value defined.

CPPExpressionget_default_value () const
 Returns the expression corresponding to this parameter's default value.

void set_default_value (CPPExpression *expr)
 Records a default value to be associated with this parameter.

virtual string temporary_to_return (const string &temporary)
 Returns the string that converts the expression stored in the indicated temporary variable to the appropriate return value type.

virtual bool return_value_needs_management ()
 Returns true if the return value represents a value that was newly allocated, and hence must be explicitly deallocated later by the caller.

virtual FunctionIndex get_return_value_destructor ()
 If return_value_needs_management() returns true, this should return the index of the function that should be called when it is time to destruct the return value.

virtual bool return_value_should_be_simple ()
 This is a hack around a problem VC++ has with overly-complex expressions, particularly in conjunction with the 'new' operator.

virtual bool is_this ()
 Returns true if this is the "this" parameter.


Protected Attributes

bool _is_valid
CPPType_orig_type
CPPType_new_type
CPPType_temporary_type
CPPExpression_default_value

Detailed Description

Maps a concrete basic_string<char> to an atomic string.

Definition at line 38 of file parameterRemapBasicStringToString.h.


Constructor & Destructor Documentation

ParameterRemapBasicStringToString::ParameterRemapBasicStringToString CPPType orig_type  ) 
 

Definition at line 33 of file parameterRemapBasicStringToString.cxx.


Member Function Documentation

CPPExpression * ParameterRemap::get_default_value  )  const [inline, inherited]
 

Returns the expression corresponding to this parameter's default value.

Definition at line 135 of file parameterRemap.I.

CPPType * ParameterRemap::get_new_type  )  const [inline, inherited]
 

Returns the type of the wrapper's parameter or return value.

This is the type that will be reported in the interrogate database, and the type that the scripting language is expected to deal with.

Definition at line 82 of file parameterRemap.I.

References ParameterRemap::_temporary_type.

CPPType * ParameterRemap::get_orig_type  )  const [inline, inherited]
 

Returns the type of the original, C++ parameter or return value.

Definition at line 63 of file parameterRemap.I.

References ParameterRemap::_new_type, and INLINE.

Referenced by FunctionRemap::get_parameter_name().

string ParameterRemapBasicStringToString::get_return_expr const string &  expression  )  [virtual]
 

Returns an expression that evalutes to the appropriate value type for returning from the function, given an expression of the original type.

Reimplemented from ParameterRemapToString.

Definition at line 91 of file parameterRemapBasicStringToString.cxx.

FunctionIndex ParameterRemap::get_return_value_destructor  )  [virtual, inherited]
 

If return_value_needs_management() returns true, this should return the index of the function that should be called when it is time to destruct the return value.

It will generally be the same as the destructor for the class we just returned a pointer to.

Reimplemented in ParameterRemapConcreteToPointer.

Definition at line 152 of file parameterRemap.cxx.

CPPType * ParameterRemap::get_temporary_type  )  const [inline, inherited]
 

Returns the type of any temporary variables used to hold the return value before returning it.

This is normally the same as get_new_type(), but in some circumstances it may need to be different.

Definition at line 101 of file parameterRemap.I.

References ParameterRemap::_default_value, and INLINE.

bool ParameterRemap::has_default_value  )  const [inline, inherited]
 

Returns true if this particular parameter has a default value defined.

Definition at line 120 of file parameterRemap.I.

bool ParameterRemap::is_this  )  [virtual, inherited]
 

Returns true if this is the "this" parameter.

Reimplemented in ParameterRemapThis.

Definition at line 214 of file parameterRemap.cxx.

bool ParameterRemap::is_valid  )  const [inline, inherited]
 

Definition at line 48 of file parameterRemap.I.

References ParameterRemap::_orig_type, and INLINE.

bool ParameterRemapToString::new_type_is_atomic_string  )  [virtual, inherited]
 

Returns true if the type represented by the conversion is now the atomic string type.

We have to have this crazy method for representing atomic string, because there's no such type in C (and hence no corresponding CPPType *).

Reimplemented from ParameterRemap.

Definition at line 95 of file parameterRemapToString.cxx.

void ParameterRemapBasicStringToString::pass_parameter ostream &  out,
const string &  variable_name
[virtual]
 

Outputs an expression that converts the indicated variable from the original type to the new type, for passing into the actual C++ function.

Reimplemented from ParameterRemapToString.

Definition at line 51 of file parameterRemapBasicStringToString.cxx.

References InterfaceMaker::indent().

string ParameterRemapBasicStringToString::prepare_return_expr ostream &  out,
int  indent_level,
const string &  expression
[virtual]
 

This will be called immediately before get_return_expr().

It outputs whatever lines the remapper needs to the function to set up its return value, e.g. to declare a temporary variable or something. It should return the modified expression.

Reimplemented from ParameterRemap.

Definition at line 72 of file parameterRemapBasicStringToString.cxx.

bool ParameterRemap::return_value_needs_management  )  [virtual, inherited]
 

Returns true if the return value represents a value that was newly allocated, and hence must be explicitly deallocated later by the caller.

Reimplemented in ParameterRemapConcreteToPointer.

Definition at line 129 of file parameterRemap.cxx.

bool ParameterRemap::return_value_should_be_simple  )  [virtual, inherited]
 

This is a hack around a problem VC++ has with overly-complex expressions, particularly in conjunction with the 'new' operator.

If this parameter type is one that will probably give VC++ a headache, this should be set true to indicate that the code generator should save the return value expression into a temporary variable first, and pass the temporary variable name in instead.

Reimplemented in ParameterRemapConcreteToPointer.

Definition at line 179 of file parameterRemap.cxx.

void ParameterRemap::set_default_value CPPExpression expr  )  [inline, inherited]
 

Records a default value to be associated with this parameter.

Definition at line 150 of file parameterRemap.I.

string ParameterRemap::temporary_to_return const string &  temporary  )  [virtual, inherited]
 

Returns the string that converts the expression stored in the indicated temporary variable to the appropriate return value type.

This is normally a pass-through, but in cases when the temporary variable type must be different than the return type (i.e. get_temporary_type() != get_new_type()), this might perform some operation.

Reimplemented in ParameterRemapPTToPointer.

Definition at line 112 of file parameterRemap.cxx.


Member Data Documentation

CPPExpression* ParameterRemap::_default_value [protected, inherited]
 

Definition at line 96 of file parameterRemap.h.

Referenced by ParameterRemap::get_temporary_type(), and ParameterRemap::ParameterRemap().

bool ParameterRemap::_is_valid [protected, inherited]
 

Definition at line 91 of file parameterRemap.h.

CPPType* ParameterRemap::_new_type [protected, inherited]
 

Definition at line 94 of file parameterRemap.h.

Referenced by ParameterRemap::get_orig_type().

CPPType* ParameterRemap::_orig_type [protected, inherited]
 

Definition at line 93 of file parameterRemap.h.

Referenced by ParameterRemap::is_valid(), and ParameterRemapConcreteToPointer::pass_parameter().

CPPType* ParameterRemap::_temporary_type [protected, inherited]
 

Definition at line 95 of file parameterRemap.h.

Referenced by ParameterRemap::get_new_type(), and ParameterRemap::ParameterRemap().


The documentation for this class was generated from the following files:
Generated on Thu May 1 22:13:41 2003 for DTool by doxygen1.3