diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-09-07 19:29:44 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-09-07 19:29:44 +0000 |
commit | f7e3832e4698fb713d1ac2180261dffcb0b317bc (patch) | |
tree | bf6781aed76cb40035e8362d7459802dace17a7c | |
parent | f1364aa08500771d47eac5d83eeb52474b8d1b97 (diff) | |
download | ATCD-f7e3832e4698fb713d1ac2180261dffcb0b317bc.tar.gz |
ChangeLogTag: Fri Sep 7 19:28:33 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_enum.cpp | 23 |
2 files changed, 19 insertions, 10 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 2e40d299477..86bc690f2d8 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,9 @@ +Fri Sep 7 19:28:33 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/be/be_enum.cpp: + + One more bit of old code that needed to be restored, + Fri Sep 7 18:42:26 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> * TAO_IDL/be/be_enum.cpp: diff --git a/TAO/TAO_IDL/be/be_enum.cpp b/TAO/TAO_IDL/be/be_enum.cpp index 07b93e88585..7471d529168 100644 --- a/TAO/TAO_IDL/be/be_enum.cpp +++ b/TAO/TAO_IDL/be/be_enum.cpp @@ -72,20 +72,23 @@ be_enum::be_enum (UTL_ScopedName *n, void be_enum::gen_ostream_operator (TAO_OutStream *os) { - static ACE_CString const tao_enumerators ("_tao_enumerators_"); - ACE_CString const enumerators_name (tao_enumerators - + this->flat_name ()); *os << be_nl << "std::ostream& operator<< (std::ostream &strm, const " << this->name () << " _tao_enumerator)" << be_nl << "{" << be_idt_nl - << "if( 0 <= _tao_enumerator && " << this->member_count () << " > _tao_enumerator )" << be_idt_nl - << "{" << be_idt_nl - << "return strm << " << enumerators_name.c_str () << "[_tao_enumerator];" << be_uidt_nl - << "}" << be_uidt_nl - << "else" << be_idt_nl - << "{" << be_idt_nl - << "return strm;" << be_uidt_nl + << "switch (_tao_enumerator)" << be_idt_nl + << "{" << be_idt_nl; + + for (int i = 0; i < this->member_count (); ++i) + { + UTL_ScopedName *mname = + this->value_to_name (static_cast<unsigned long> (i)); + + *os << "case " << i << ": return strm << \"" + << mname << "\";" << be_nl; + } + + *os << "default: return strm;" << be_uidt_nl << "}" << be_uidt << be_uidt_nl << "}" << be_nl; } |