osaf/services/saf/amf/amfd/ckpt_dec.cc           |   8 +++++++-
 osaf/services/saf/amf/amfd/include/db_template.h |   4 +++-
 osaf/services/saf/amf/amfd/include/su.h          |   2 --
 osaf/services/saf/amf/amfd/su.cc                 |  21 ---------------------
 4 files changed, 10 insertions(+), 25 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/ckpt_dec.cc 
b/osaf/services/saf/amf/amfd/ckpt_dec.cc
--- a/osaf/services/saf/amf/amfd/ckpt_dec.cc
+++ b/osaf/services/saf/amf/amfd/ckpt_dec.cc
@@ -1313,7 +1313,13 @@ static uint32_t dec_su_oper_state(AVD_CL
 
        osaf_decode_sanamet(&dec->i_uba, &name);
        
-       AVD_SU *su = avd_su_get_or_create(&name);
+       AVD_SU *su = su_db->find(Amf::to_string(&name));
+       if (su == NULL) {
+               TRACE("'%s' does not exist, creating it", name.value);
+               su = new AVD_SU(&name);
+               unsigned int rc = su_db->insert(Amf::to_string(&su->name), su);
+               osafassert(rc == NCSCC_RC_SUCCESS);
+       }
        
        osaf_decode_uint32(&dec->i_uba, (uint32_t*)&su->saAmfSUOperState);
 
diff --git a/osaf/services/saf/amf/amfd/include/db_template.h 
b/osaf/services/saf/amf/amfd/include/db_template.h
--- a/osaf/services/saf/amf/amfd/include/db_template.h
+++ b/osaf/services/saf/amf/amfd/include/db_template.h
@@ -23,7 +23,9 @@
 //
 class Amf {
 public:
-  static std::string to_string(const SaNameT *name) {return 
std::string((char*)name->value, name->length);}
+  static std::string to_string(const SaNameT *name) {
+         return std::string((char*)name->value, name->length);
+  }
 };
 
 //
diff --git a/osaf/services/saf/amf/amfd/include/su.h 
b/osaf/services/saf/amf/amfd/include/su.h
--- a/osaf/services/saf/amf/amfd/include/su.h
+++ b/osaf/services/saf/amf/amfd/include/su.h
@@ -156,6 +156,4 @@ extern SaAisErrorT avd_su_config_get(con
  */
 extern void avd_su_constructor(void);
 
-extern AVD_SU *avd_su_get_or_create(const SaNameT *dn);
-
 #endif
diff --git a/osaf/services/saf/amf/amfd/su.cc b/osaf/services/saf/amf/amfd/su.cc
--- a/osaf/services/saf/amf/amfd/su.cc
+++ b/osaf/services/saf/amf/amfd/su.cc
@@ -87,27 +87,6 @@ void AVD_SU::remove_from_model() {
 }
 
 /**
- * Return an SU object if it exist, otherwise create it and
- * return a reference to the new object.
- * @param dn
- * 
- * @return AVD_SU*
- */
-AVD_SU *avd_su_get_or_create(const SaNameT *dn)
-{
-       AVD_SU *su = su_db->find(Amf::to_string(dn));
-
-       if (su == NULL) {
-               TRACE("'%s' does not exist, creating it", dn->value);
-               su = new AVD_SU(dn);
-               unsigned int rc = su_db->insert(Amf::to_string(&su->name), su);
-               osafassert(rc == NCSCC_RC_SUCCESS);
-       }
-
-       return su;
-}
-
-/**
  * @brief   gets the current no of assignmnents on a SU for a particular state
  *
  * @param[in] ha_state  

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to