diff options
author | labancap <labancap@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2013-01-21 21:45:13 +0000 |
---|---|---|
committer | labancap <labancap@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2013-01-21 21:45:13 +0000 |
commit | 86cea02a072fd20a4900bdad132a635fd7f72ef9 (patch) | |
tree | 75b47d348428b782ab1050e23cb13ca520f5dc00 | |
parent | 7f5fe5e3e6a6ca3801f600a883581510e9ed7dfb (diff) | |
download | ATCD-86cea02a072fd20a4900bdad132a635fd7f72ef9.tar.gz |
Updated based on ACE Development Guidelines in preparation for merge
10 files changed, 112 insertions, 85 deletions
diff --git a/TAO/OCI_RE_ChangeLog b/TAO/OCI_RE_ChangeLog index bff77da13bf..fc9a7dcbae5 100644 --- a/TAO/OCI_RE_ChangeLog +++ b/TAO/OCI_RE_ChangeLog @@ -1,3 +1,18 @@ +Mon Jan 21 21:43:20 UTC 2013 Phillip LaBanca <labancap@ociweb.com> + + * orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h: + * orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp: + * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp: + * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp: + * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h: + * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp: + * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h: + * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp: + * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_ReaderWriter.cpp: + + Updated based on ACE Development Guidelines in preparation + for merge. + Fri Jan 18 23:51:32 UTC 2013 Phillip LaBanca <labancap@ociweb.com> * orbsvcs/Naming_Service/FT_Naming_Main.cpp: diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp index a87553a9186..5da2864d20e 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp @@ -193,14 +193,6 @@ TAO_Persistent_Context_Index::recreate_all (void) this, entry->int_id_.hash_map_, entry->int_id_.counter_); -/* ACE_NEW_RETURN (context_impl, - TAO_Persistent_Naming_Context (poa_.in (), - entry->ext_id_.poa_id_, - this, - entry->int_id_.hash_map_, - entry->int_id_.counter_), - -1); -*/ // Put <context_impl> into the auto pointer temporarily, in case next // allocation fails. @@ -238,8 +230,9 @@ TAO_Persistent_Context_Index::recreate_all (void) } TAO_Persistent_Naming_Context* -TAO_Persistent_Context_Index::create_naming_context_impl (PortableServer::POA_ptr poa, - const char *poa_id) +TAO_Persistent_Context_Index::create_naming_context_impl ( + PortableServer::POA_ptr poa, + const char *poa_id) { return this->context_impl_factory_->create_naming_context_impl(poa, poa_id, diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h index 027fc7a8b2c..9b7f0a26010 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h +++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h @@ -67,9 +67,10 @@ public: // = Initialization and termination methods. /// Constructor. - TAO_Persistent_Context_Index (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - TAO_Persistent_Naming_Context_Factory *context_impl_factory); + TAO_Persistent_Context_Index ( + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + TAO_Persistent_Naming_Context_Factory *context_impl_factory); /** * Create ACE_Allocator, open/create memory-mapped file with the @@ -94,8 +95,9 @@ public: * using the naming context factory that was provided in the ctor * for the index. */ - TAO_Persistent_Naming_Context *create_naming_context_impl (PortableServer::POA_ptr poa, - const char *poa_id); + TAO_Persistent_Naming_Context *create_naming_context_impl ( + PortableServer::POA_ptr poa, + const char *poa_id); /** * Destructor. The memory mapped file that was opened/created is diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp index 2974fd56879..6a90a325ae9 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp @@ -250,7 +250,8 @@ TAO_Persistent_Naming_Context::TAO_Persistent_Naming_Context (PortableServer::PO // Set the superclass pointer. context_ = persistent_context_; - // If a map was provided (i.e., not defaulted) then set it in the persistent_context_ + // If a map was provided (i.e., not defaulted) then set it in the + // persistent_context_ if (map != 0) persistent_context_->set (map, index_->allocator ()); } @@ -294,8 +295,9 @@ TAO_Persistent_Naming_Context::make_new_context (PortableServer::POA_ptr poa, // Put together a servant for the new Naming Context. - TAO_Persistent_Naming_Context *context_impl = ind->create_naming_context_impl(poa, - poa_id); + TAO_Persistent_Naming_Context *context_impl = ind->create_naming_context_impl( + poa, + poa_id); // Verify that a context implementation was created. If not, throw an exception if (context_impl == 0) diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp index 33fd12a4541..6cc93bdef1f 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp @@ -5,14 +5,14 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL - /// Constructor. +/// Constructor. TAO_Persistent_Naming_Context_Factory::TAO_Persistent_Naming_Context_Factory (void) { } - /// Destructor. Does not deallocate the hash map: if an instance of - /// this class goes out of scope, its hash_map remains in persistent storage. +/// Destructor. Does not deallocate the hash map: if an instance of +/// this class goes out of scope, its hash_map remains in persistent storage. TAO_Persistent_Naming_Context_Factory::~TAO_Persistent_Naming_Context_Factory (void) { } diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp index 0e2937db3af..28a52a40254 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp @@ -61,7 +61,7 @@ TAO_Storable_Naming_Context_Activator::incarnate ( { // Does this already exist on disk? - ACE_TString file_name = ACE_TEXT_CHAR_TO_TCHAR(poa_id.in ()); + ACE_TString file_name = ACE_TEXT_CHAR_TO_TCHAR (poa_id.in ()); ACE_Auto_Ptr<TAO::Storable_Base> fl ( persistence_factory_->create_stream (ACE_TEXT_ALWAYS_CHAR (file_name.c_str ()), ACE_TEXT ("rw"))); diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h index 0930deb502e..d7cbfeb79ba 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h +++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h @@ -48,10 +48,11 @@ public: * The constructor takes arguments needed to create a * TAO_Storable_Naming_Context and TAO_Naming_Context on demand. */ - TAO_Storable_Naming_Context_Activator (CORBA::ORB_ptr orb, - TAO::Storable_Factory *factory, - TAO_Storable_Naming_Context_Factory *context_impl_factory, - const ACE_TCHAR *persistence_directory); + TAO_Storable_Naming_Context_Activator ( + CORBA::ORB_ptr orb, + TAO::Storable_Factory *factory, + TAO_Storable_Naming_Context_Factory *context_impl_factory, + const ACE_TCHAR *persistence_directory); virtual ~TAO_Storable_Naming_Context_Activator(); diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp index 3e771d70bf5..78a91dd1a57 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp @@ -7,15 +7,16 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL - /// Constructor. -TAO_Storable_Naming_Context_Factory::TAO_Storable_Naming_Context_Factory (size_t hash_table_size) +/// Constructor. +TAO_Storable_Naming_Context_Factory::TAO_Storable_Naming_Context_Factory ( + size_t hash_table_size) : context_size_(hash_table_size) { } - /// Destructor. Does not deallocate the hash map: if an instance of - /// this class goes out of scope, its hash_map remains in persistent storage. +/// Destructor. Does not deallocate the hash map: if an instance of +/// this class goes out of scope, its hash_map remains in persistent storage. TAO_Storable_Naming_Context_Factory::~TAO_Storable_Naming_Context_Factory (void) { @@ -23,12 +24,13 @@ TAO_Storable_Naming_Context_Factory::~TAO_Storable_Naming_Context_Factory (void) TAO_Storable_Naming_Context* -TAO_Storable_Naming_Context_Factory::create_naming_context_impl (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - const char *poa_id, - TAO::Storable_Factory *persistence_factory) +TAO_Storable_Naming_Context_Factory::create_naming_context_impl ( + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const char *poa_id, + TAO::Storable_Factory *persistence_factory) { - // Construct the naming context, forwarding the map and counter even if they + // Construct the naming context, forwarding the map and counter even if they // are defaulted TAO_Storable_Naming_Context *context_impl; ACE_NEW_THROW_EX (context_impl, diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h index f46f7bb8246..748bd60f772 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h +++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h @@ -37,25 +37,29 @@ class TAO_Naming_Serv_Export TAO_Storable_Naming_Context_Factory { public: - /// Data structure used by TAO_Persistent_Context_Index - typedef for ease of use. + /// Data structure used by TAO_Persistent_Context_Index + /// - typedef for ease of use. typedef TAO_Storable_Naming_Context::HASH_MAP HASH_MAP; // = Initialization and termination methods. /// Constructor. - TAO_Storable_Naming_Context_Factory (size_t hash_table_size = ACE_DEFAULT_MAP_SIZE); + TAO_Storable_Naming_Context_Factory ( + size_t hash_table_size = ACE_DEFAULT_MAP_SIZE); /// Destructor. Does not deallocate the hash map: if an instance of /// this class goes out of scope, its hash_map remains in persistent storage. virtual ~TAO_Storable_Naming_Context_Factory (void); /// Factory method for creating an implementation object for naming contexts. - /// If an existing naming context implementation is being rebuilt, the map and counter parameters - /// should be provided to the underlying HASH_MAP implementation - virtual TAO_Storable_Naming_Context* create_naming_context_impl (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - const char *poa_id, - TAO::Storable_Factory *factory); + /// If an existing naming context implementation is being rebuilt, the map + /// and counter parameters should be provided to the underlying HASH_MAP + /// implementation + virtual TAO_Storable_Naming_Context* create_naming_context_impl ( + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const char *poa_id, + TAO::Storable_Factory *factory); protected: /// The size for persisted naming context objects in hash map diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_ReaderWriter.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_ReaderWriter.cpp index e1a43c12cae..91abe2ed650 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_ReaderWriter.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_ReaderWriter.cpp @@ -21,27 +21,30 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Storable_Naming_Context_ReaderWriter:: TAO_Storable_Naming_Context_ReaderWriter (TAO::Storable_Base & stream) - : stream_(stream) + : stream_ (stream) { } void -TAO_Storable_Naming_Context_ReaderWriter::write (TAO_Storable_Naming_Context & context) +TAO_Storable_Naming_Context_ReaderWriter::write ( + TAO_Storable_Naming_Context & context) { TAO_NS_Persistence_Header header; - header.size (static_cast<unsigned int> (context.storable_context_->current_size())); + header.size (static_cast<unsigned int> ( + context.storable_context_->current_size ())); + header.destroyed (context.destroyed_); - this->write_header(header); + this->write_header (header); if (0u == header.size ()) return; - ACE_Hash_Map_Iterator<TAO_Storable_ExtId,TAO_Storable_IntId, - ACE_Null_Mutex> it = context.storable_context_->map().begin(); - ACE_Hash_Map_Iterator<TAO_Storable_ExtId,TAO_Storable_IntId, - ACE_Null_Mutex> itend = context.storable_context_->map().end(); + ACE_Hash_Map_Iterator<TAO_Storable_ExtId,TAO_Storable_IntId, ACE_Null_Mutex> + it = context.storable_context_->map ().begin (); + ACE_Hash_Map_Iterator<TAO_Storable_ExtId,TAO_Storable_IntId,ACE_Null_Mutex> + itend = context.storable_context_->map ().end (); ACE_Hash_Map_Entry<TAO_Storable_ExtId,TAO_Storable_IntId> ent = *it; @@ -104,32 +107,34 @@ TAO_Storable_Naming_Context_ReaderWriter::write (TAO_Storable_Naming_Context & c name.set ((*it).int_id_.ref_.in ()); // The non-context object IOR record.type (TAO_NS_Persistence_Record::OBJREF); } - record.ref(name); + record.ref (name); - const char *myid = (*it).ext_id_.id(); - ACE_CString id(myid); - record.id(id); + const char *myid = (*it).ext_id_.id (); + ACE_CString id (myid); + record.id (id); - const char *mykind = (*it).ext_id_.kind(); - ACE_CString kind(mykind); - record.kind(kind); + const char *mykind = (*it).ext_id_.kind (); + ACE_CString kind (mykind); + record.kind (kind); write_record (record); - it.advance(); + it.advance (); } context.write_occurred_ = 1; } int -TAO_Storable_Naming_Context_ReaderWriter::read (TAO_Storable_Naming_Context & context) +TAO_Storable_Naming_Context_ReaderWriter::read ( + TAO_Storable_Naming_Context & context) { // assume file already open for reading TAO_Storable_Bindings_Map *bindings_map; // create the new bindings map ACE_NEW_THROW_EX (bindings_map, - TAO_Storable_Bindings_Map (context.hash_table_size_, context.orb_.in()), + TAO_Storable_Bindings_Map (context.hash_table_size_, + context.orb_.in ()), CORBA::NO_MEMORY ()); // get the data for this bindings map from the file @@ -138,7 +143,7 @@ TAO_Storable_Naming_Context_ReaderWriter::read (TAO_Storable_Naming_Context & co TAO_NS_Persistence_Record record; // we are only using the size from this header - this->read_header(header); + this->read_header (header); if (!stream_.good ()) { stream_.clear (); @@ -146,12 +151,12 @@ TAO_Storable_Naming_Context_ReaderWriter::read (TAO_Storable_Naming_Context & co } // reset the destroyed flag - context.destroyed_ = header.destroyed(); + context.destroyed_ = header.destroyed (); // read in the data for the map - for (unsigned int i= 0u; i<header.size(); ++i) + for (unsigned int i= 0u; i<header.size (); ++i) { - this->read_record(record); + this->read_record (record); if (!stream_.good ()) { stream_.clear (); @@ -178,7 +183,8 @@ TAO_Storable_Naming_Context_ReaderWriter::read (TAO_Storable_Naming_Context & co bindings_map->bind ( record.id ().c_str (), record.kind ().c_str (), objref.in (), - ((TAO_NS_Persistence_Record::REMOTE_NCONTEXT == record.type ()) + ((TAO_NS_Persistence_Record::REMOTE_NCONTEXT + == record.type ()) ? CosNaming::ncontext // REMOTE_NCONTEXT : CosNaming::nobject )); // OBJREF } @@ -189,39 +195,41 @@ TAO_Storable_Naming_Context_ReaderWriter::read (TAO_Storable_Naming_Context & co } void -TAO_Storable_Naming_Context_ReaderWriter::write_header (const TAO_NS_Persistence_Header & header) +TAO_Storable_Naming_Context_ReaderWriter::write_header ( + const TAO_NS_Persistence_Header & header) { - stream_.rewind(); - stream_ << header.size(); - stream_ << header.destroyed(); - stream_.flush(); + stream_.rewind (); + stream_ << header.size (); + stream_ << header.destroyed (); + stream_.flush (); } void -TAO_Storable_Naming_Context_ReaderWriter::read_header (TAO_NS_Persistence_Header & header) +TAO_Storable_Naming_Context_ReaderWriter::read_header ( + TAO_NS_Persistence_Header & header) { unsigned int size; int destroyed; - stream_.rewind(); + stream_.rewind (); stream_ >> size; - header.size(size); + header.size (size); stream_ >> destroyed; - header.destroyed(destroyed); + header.destroyed (destroyed); } void TAO_Storable_Naming_Context_ReaderWriter::write_record (const TAO_NS_Persistence_Record & record) { - TAO_NS_Persistence_Record::Record_Type type = record.type(); + TAO_NS_Persistence_Record::Record_Type type = record.type (); stream_ << type; - stream_ << record.id(); - stream_ << record.kind(); - stream_ << record.ref(); + stream_ << record.id (); + stream_ << record.kind (); + stream_ << record.ref (); - stream_.flush(); + stream_.flush (); } void @@ -249,9 +257,9 @@ TAO_Storable_Naming_Context_ReaderWriter::read_record (TAO_NS_Persistence_Record void TAO_Storable_Naming_Context_ReaderWriter::write_global (const TAO_NS_Persistence_Global & global) { - stream_.rewind(); - stream_ << global.counter(); - stream_.flush(); + stream_.rewind (); + stream_ << global.counter (); + stream_.flush (); } void @@ -259,9 +267,9 @@ TAO_Storable_Naming_Context_ReaderWriter::read_global (TAO_NS_Persistence_Global { unsigned int counter = 0; - stream_.rewind(); + stream_.rewind (); stream_ >> counter; - global.counter(counter); + global.counter (counter); } |