Commits

ca...@4525493e-7705-40b1-a816-d608a930855b  committed d058edc

documentation standdown

  • Participants
  • Parent commits 459a60f

Comments (0)

Files changed (5)

+2007-06-16  Paolo Calafiura
+        * doc standdown
+	* src/ClassIDSvc.cxx: don't write out clid.db by default 
+	tag CLIDComps-00-00-02
+
 2007-03-02  Paolo Calafiura  <pcalafiura@lbl.gov>
         * cmt/requirements: added needed use statements 
 	* test/ClassIDSvc_test.cxx: fixed include

File cmt/requirements

 use TestTools       TestTools-*          AtlasTest
 apply_pattern UnitTest_run unit_test=ClassIDSvc
 
+macro_append DOXYGEN_INPUT " ../test ../share " 
 
 
+

File src/ClassIDSvc.cxx

-//<<<<<< INCLUDES                                                       >>>>>>
-
 #include <algorithm>  /* distance */
 #include <cstdlib>    /* getenv */
 #include <fstream>
 
 /// Standard Constructor
 ClassIDSvc::ClassIDSvc(const std::string& name,ISvcLocator* svc)
-  : Service(name,svc), m_outputFileName("./CLIDDBout.txt")
+  : Service(name,svc), m_outputFileName("NULL")
 {
   // Property Default values
   //  m_DBFiles.push_back("./CLIDDB.txt");
     
   // Get user's input	
-  declareProperty("CLIDDBFiles",  m_DBFiles);
-  declareProperty("OutputFileName",  m_outputFileName);
+  declareProperty("CLIDDBFiles",  m_DBFiles, 
+		  "list of db files with (CLID, class_name) entries. Loaded at init in svc maps");
+  declareProperty("OutputFileName",  m_outputFileName,
+		  "path to clid.db file in which write at finalize entries in m_clidMap. Default ('NULL') is not to write output clid.db");
 
 }
 
 StatusCode 
 ClassIDSvc::finalize()
 {
-  ofstream outfile( m_outputFileName.c_str());
-  if ( !outfile ) {
-    MsgStream log(messageService(), name());
-    log << MSG::ERROR << "unable to open output CLIDDB file: " << m_outputFileName << endreq;
-    return StatusCode::FAILURE;
-  } else {
-    //    ostream_iterator< pair<CLID, string> > os(outfile, ':');
-    //    copy(m_clidMap.begin(), m_clidMap,end(), os);
-    CLIDMap::const_iterator i(m_clidMap.begin()), iE(m_clidMap.end());
-    while (i != iE) {
-      outfile << i->first << ' ' << i->second << endl;
-      ++i;
+  if (m_outputFileName != "NULL") {
+    ofstream outfile( m_outputFileName.c_str());
+    if ( !outfile ) {
+      MsgStream log(messageService(), name());
+      log << MSG::ERROR << "unable to open output CLIDDB file: " << m_outputFileName << endreq;
+      return StatusCode::FAILURE;
+    } else {
+      //    ostream_iterator< pair<CLID, string> > os(outfile, ':');
+      //    copy(m_clidMap.begin(), m_clidMap,end(), os);
+      CLIDMap::const_iterator i(m_clidMap.begin()), iE(m_clidMap.end());
+      while (i != iE) {
+	outfile << i->first << ' ' << i->second << endl;
+	++i;
+      }
+      MsgStream log(messageService(), name());
+      log << MSG::DEBUG << "finalize: wrote " << m_clidMap.size() 
+	  << " entries to output CLIDDB file: " << m_outputFileName << endreq;
     }
-#ifndef NDEBUG
-    MsgStream log(messageService(), name());
-    log << MSG::DEBUG << "finalize: wrote " << m_clidMap.size() 
-	<< " entries to output CLIDDB file: " << m_outputFileName << endreq;
-#endif
-  }
-  outfile.close();
+    outfile.close();
+  } //outputfilename != NULL
   return Service::finalize();
 }
 

File src/ClassIDSvc.h

 #ifndef CLIDSVC_CLASSIDSVC_H
 # define CLIDSVC_CLASSIDSVC_H
+/** @file ClassIDSvc.h
+ * @brief a service to manage and verify CLID assignments in athena
 
-//<<<<<< INCLUDES                                                       >>>>>>
+ * @author Paolo Calafiura <pcalafiura@lbl.gov> - ATLAS Collaboration
+ *$Id: ClassIDSvc.h,v 1.2 2007-06-16 20:34:59 calaf Exp $
+ */
+
 #ifndef _CPP_MAP
  #include <map>
 #endif
  #include "GaudiKernel/Service.h"
 #endif
 
-//<<<<<< FORWARD DECLARATIONS                                           >>>>>>
 template <class TYPE> class SvcFactory;
 
-//<<<<<< CLASS DECLARATIONS                                             >>>>>>
 /** @class ClassIDSvc 
- * @brief  a service to access to the CLID database
+ * @brief a service to manage and verify CLID assignments in athena.
+ *
+ * @details (clid, class_name) entries are loaded at init from the list of
+ * files specifies in "CLIDDBFiles", and from the CLID_Registry of every
+ * library. Optionally the resulting m_clidMap can be dumped to 
+ * "OutputFileName" at finalize time.
+ */
 
- * @author Paolo Calafiura <pcalafiura@lbl.gov> - ATLAS Collaboration
- *$Id: ClassIDSvc.h,v 1.1.1.1 2007-03-02 00:02:29 calaf Exp $
- */
 
 class ClassIDSvc : virtual public IClassIDSvc, 
                    virtual public IIncidentListener, 
   typedef std::map<CLID, Athena::PackageInfo> PackageMap; 
 public:
   /// get next available CLID 
-  /// @throws std::runtime_error if no CLID can be allocated
-  virtual CLID nextAvailableID() const;
+  /// @throws std::runtime_error if no CLID can be allocated  virtual CLID nextAvailableID() const;
+  CLID nextAvailableID() const;
   /// check if id is used
   virtual bool isIDInUse(const CLID& id) const;
   /// check if id is used
   uncheckedSetTypePackageForID(const CLID& id, const std::string& typeName,
 			       const Athena::PackageInfo& info);
 
+  /// @name Properties
+  //@{
+  /// "CLIDDBFiles": list of db files with (CLID, class_name) entries. Loaded at init in svc maps
   std::vector<std::string> m_DBFiles;
+  /// "OutputFileName": path to clid.db file in which write at finalize entries in m_clidMap. Default ("NULL") is not to write output clid.db".
   std::string m_outputFileName;
+  //@}
   CLIDMap m_clidMap;
   NameMap m_nameMap;
   PackageMap m_packageMap;

File test/ClassIDSvc_test.cxx

-/** @file ClassIDSvc_test.cxx  unit test for ClassIDSvc
+/** @file ClassIDSvc_test.cxx  
+ * @brief unit test for ClassIDSvc
  * @author ATLAS Collaboration
- * $Id: ClassIDSvc_test.cxx,v 1.2 2007-03-02 21:20:49 calaf Exp $
+ * $Id: ClassIDSvc_test.cxx,v 1.3 2007-06-16 20:34:59 calaf Exp $
  ***************************************************************************/
 
 #undef NDEBUG