diff options
author | fhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-03-28 17:26:05 +0000 |
---|---|---|
committer | fhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-03-28 17:26:05 +0000 |
commit | 0648b0546ddcdbe76fb33cbabc95d9626d993b22 (patch) | |
tree | 06d133d32a61f65ad1c37af73e6211fa43146d46 /TAO/tao/Service_Context.cpp | |
parent | e0735f909f4e7a11a39607c87ebadaa10ab1e812 (diff) | |
download | ATCD-0648b0546ddcdbe76fb33cbabc95d9626d993b22.tar.gz |
ChangeLogTag: Wed Mar 28 09:31:54 2001 Frank Hunleth <fhunleth@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Service_Context.cpp')
-rw-r--r-- | TAO/tao/Service_Context.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/TAO/tao/Service_Context.cpp b/TAO/tao/Service_Context.cpp index bd4fe1fc218..a66868d404d 100644 --- a/TAO/tao/Service_Context.cpp +++ b/TAO/tao/Service_Context.cpp @@ -57,6 +57,28 @@ TAO_Service_Context::set_context (const IOP::ServiceContext &context) this->add_context_i (context); } +int +TAO_Service_Context::set_context (const IOP::ServiceContext &context, + CORBA::Boolean replace) +{ + for (CORBA::ULong i = 0; i != this->service_context_.length (); ++i) + { + if (context.context_id == this->service_context_[i].context_id) + { + if (replace) + { + this->service_context_[i] = context; + return 1; + } + else + return 0; + } + } + + this->add_context_i (context); + return 1; +} + void TAO_Service_Context::set_context (IOP::ServiceContext &context) { @@ -134,6 +156,19 @@ TAO_Service_Context::get_context (IOP::ServiceContext& context) const return 0; } +int +TAO_Service_Context::get_context (IOP::ServiceId id, const IOP::ServiceContext **context) const +{ + for (CORBA::ULong i = 0; i != this->service_context_.length (); ++i) + { + if (id == this->service_context_[i].context_id) + { + *context = &this->service_context_[i]; + return 1; + } + } + return 0; +} int TAO_Service_Context::encode (TAO_OutputCDR& cdr) const |