#include <PSDL_Enum_Type_Visitor.h>
Inheritance diagram for TAO_PSDL_Enum_Type_Visitor:


Public Member Functions | |
| TAO_PSDL_Enum_Type_Visitor () | |
| ~TAO_PSDL_Enum_Type_Visitor () | |
| int | visit_identifier (TAO_PSDL_Identifier *identifier) |
| int | visit_enumerator (TAO_PSDL_Enumerator *enumerator) |
| int | visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type) |
Private Member Functions | |
| void | print_class_for_enum_type (ACE_CString enum_type_name) |
Definition at line 32 of file PSDL_Enum_Type_Visitor.h.
| TAO_PSDL_Enum_Type_Visitor::TAO_PSDL_Enum_Type_Visitor | ( | ) |
| TAO_PSDL_Enum_Type_Visitor::~TAO_PSDL_Enum_Type_Visitor | ( | ) |
| void TAO_PSDL_Enum_Type_Visitor::print_class_for_enum_type | ( | ACE_CString | enum_type_name | ) | [private] |
Definition at line 85 of file PSDL_Enum_Type_Visitor.cpp.
References TAO_PSDL_Scope::get_sh(), TAO_PSDL_Scope::instance(), and TAO_PSDL_Stream::nl().
Referenced by visit_predefined_type().
00086 { 00087 // Get a pointer to PSDL_Stream of the stub header. 00088 TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh (); 00089 00090 ps_sh->nl (); 00091 00092 *ps_sh << "typedef " << enum_type_name << " &" 00093 << enum_type_name << "_out;\n"; 00094 00095 *ps_sh<< "TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr " 00096 << "_tc_" << enum_type_name << ";\n"; 00097 00098 ps_sh->nl (); 00099 00100 }
| int TAO_PSDL_Enum_Type_Visitor::visit_enumerator | ( | TAO_PSDL_Enumerator * | enumerator | ) | [virtual] |
Reimplemented from TAO_PSDL_Node_Visitor.
Definition at line 30 of file PSDL_Enum_Type_Visitor.cpp.
References TAO_PSDL_Node::accept(), TAO_PSDL_Node_Visitor::count_, TAO_PSDL_Enumerator::enumerator(), TAO_PSDL_Scope::get_sh(), TAO_PSDL_Enumerator::identifier(), TAO_PSDL_Node_Visitor::identifiers_, and TAO_PSDL_Scope::instance().
00031 { 00032 // Gets the enum name and saves it in the global array of 00033 // identifiers. 00034 if (enumerator->identifier ()->accept (this) == -1) 00035 return -1; 00036 00037 // Get a pointer to PSDL_Stream of the stub header. 00038 TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh (); 00039 00040 *ps_sh<< " " << this->identifiers_ [this->count_ - 1] 00041 << ";\n"; 00042 00043 // Get the enum members and save them. 00044 if (enumerator->enumerator () != 0) 00045 if (enumerator->enumerator ()->accept (this) == -1) 00046 return -1; 00047 00048 return 0; 00049 }
| int TAO_PSDL_Enum_Type_Visitor::visit_identifier | ( | TAO_PSDL_Identifier * | identifier | ) | [virtual] |
Reimplemented from TAO_PSDL_Node_Visitor.
Definition at line 18 of file PSDL_Enum_Type_Visitor.cpp.
References TAO_PSDL_Node_Visitor::count_, TAO_PSDL_Node_Visitor::identifiers_, and TAO_PSDL_Identifier::value().
00019 { 00020 // Save the identifiers for future use. 00021 this->identifiers_.size (this->count_ + 1); 00022 00023 this->identifiers_ [this->count_] = identifier->value (); 00024 00025 ++this->count_; 00026 return 0; 00027 }
| int TAO_PSDL_Enum_Type_Visitor::visit_predefined_type | ( | TAO_PSDL_Predefined_Type * | predefined_type | ) | [virtual] |
Reimplemented from TAO_PSDL_Node_Visitor.
Definition at line 52 of file PSDL_Enum_Type_Visitor.cpp.
References TAO_PSDL_Node::accept(), ACE_String_Base< CHAR >::c_str(), TAO_PSDL_Node_Visitor::count_, TAO_PSDL_Scope::get_sh(), TAO_PSDL_Node_Visitor::identifiers_, TAO_PSDL_Scope::instance(), print_class_for_enum_type(), TAO_PSDL_Predefined_Type::type_of_variable_one(), and TAO_PSDL_Predefined_Type::type_of_variable_two().
00053 { 00054 if (predefined_type->type_of_variable_one () != 0) 00055 { 00056 if (predefined_type->type_of_variable_one ()->accept (this) == -1) 00057 return -1; 00058 } 00059 00060 ACE_CString enum_type_name = this->identifiers_ [this->count_ - 1]; 00061 00062 // Get a pointer to PSDL_Stream of the stub header. 00063 TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh (); 00064 00065 *ps_sh<< "enum " << enum_type_name.c_str () << "\n"; 00066 *ps_sh<< "{\n"; 00067 00068 if (predefined_type->type_of_variable_two () != 0) 00069 { 00070 if (predefined_type->type_of_variable_two ()->accept (this) == -1) 00071 return -1; 00072 } 00073 00074 *ps_sh<< "};\n"; 00075 00076 // Print the code that should go into the generated header file. 00077 // @@ Update this method to get the code that should go to 00078 // implementation method (as applies). 00079 this->print_class_for_enum_type (enum_type_name); 00080 00081 return 0; 00082 }
1.4.7