osaf/services/saf/amf/amfd/ckpt_dec.cc  |  18 +++++++++---------
 osaf/services/saf/amf/amfd/ckpt_updt.cc |  12 ++++++------
 osaf/services/saf/amf/amfd/comp.cc      |   2 +-
 osaf/services/saf/amf/amfd/include/su.h |   2 +-
 osaf/services/saf/amf/amfd/ndproc.cc    |   2 +-
 osaf/services/saf/amf/amfd/su.cc        |  30 +++++++++++++++---------------
 6 files changed, 33 insertions(+), 33 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
@@ -1453,7 +1453,7 @@ static uint32_t dec_su_preinstan(AVD_CL_
 
        osafassert(status == NCSCC_RC_SUCCESS);
 
-       if (NULL == (su_struct = su_db->find(&su_ptr->name)))
+       if (NULL == (su_struct = su_db->find(Amf::to_string(&su_ptr->name))))
                osafassert(0);
 
        /* Update the fields received in this checkpoint message */
@@ -1545,7 +1545,7 @@ static uint32_t dec_su_admin_state(AVD_C
 
        osafassert(status == NCSCC_RC_SUCCESS);
 
-       if (NULL == (su_struct = su_db->find(&su_ptr->name)))
+       if (NULL == (su_struct = su_db->find(Amf::to_string(&su_ptr->name))))
                osafassert(0);
 
        /* Update the fields received in this checkpoint message */
@@ -1591,7 +1591,7 @@ static uint32_t dec_su_readiness_state(A
 
        osafassert(status == NCSCC_RC_SUCCESS);
 
-       if (NULL == (su_struct = su_db->find(&su_ptr->name)))
+       if (NULL == (su_struct = su_db->find(Amf::to_string(&su_ptr->name))))
                osafassert(0);
 
        /* Update the fields received in this checkpoint message */
@@ -1637,7 +1637,7 @@ static uint32_t dec_su_pres_state(AVD_CL
 
        osafassert(status == NCSCC_RC_SUCCESS);
 
-       if (NULL == (su_struct = su_db->find(&su_ptr->name)))
+       if (NULL == (su_struct = su_db->find(Amf::to_string(&su_ptr->name))))
                osafassert(0);
 
        /* Update the fields received in this checkpoint message */
@@ -1683,7 +1683,7 @@ static uint32_t dec_su_si_curr_active(AV
 
        osafassert(status == NCSCC_RC_SUCCESS);
 
-       if (NULL == (su_struct = su_db->find(&su_ptr->name)))
+       if (NULL == (su_struct = su_db->find(Amf::to_string(&su_ptr->name))))
                osafassert(0);
 
        /* Update the fields received in this checkpoint message */
@@ -1728,7 +1728,7 @@ static uint32_t dec_su_si_curr_stby(AVD_
 
        osafassert(status == NCSCC_RC_SUCCESS);
 
-       if (NULL == (su_struct = su_db->find(&su_ptr->name)))
+       if (NULL == (su_struct = su_db->find(Amf::to_string(&su_ptr->name))))
                osafassert(0);
 
        /* Update the fields received in this checkpoint message */
@@ -1774,7 +1774,7 @@ static uint32_t dec_su_term_state(AVD_CL
 
        osafassert(status == NCSCC_RC_SUCCESS);
 
-       if (NULL == (su_struct = su_db->find(&su_ptr->name)))
+       if (NULL == (su_struct = su_db->find(Amf::to_string(&su_ptr->name))))
                osafassert(0);
 
        /* Update the fields received in this checkpoint message */
@@ -1819,7 +1819,7 @@ static uint32_t dec_su_switch(AVD_CL_CB 
 
        osafassert(status == NCSCC_RC_SUCCESS);
 
-       if (NULL == (su_struct = su_db->find(&su_ptr->name)))
+       if (NULL == (su_struct = su_db->find(Amf::to_string(&su_ptr->name))))
                osafassert(0);
 
        /* Update the fields received in this checkpoint message */
@@ -1887,7 +1887,7 @@ static uint32_t dec_su_restart_count(AVD
 
        osafassert(status == NCSCC_RC_SUCCESS);
 
-       if (NULL == (su_struct = su_db->find(&su_ptr->name)))
+       if (NULL == (su_struct = su_db->find(Amf::to_string(&su_ptr->name))))
                osafassert(0);
 
        /* Update the fields received in this checkpoint message */
diff --git a/osaf/services/saf/amf/amfd/ckpt_updt.cc 
b/osaf/services/saf/amf/amfd/ckpt_updt.cc
--- a/osaf/services/saf/amf/amfd/ckpt_updt.cc
+++ b/osaf/services/saf/amf/amfd/ckpt_updt.cc
@@ -102,7 +102,7 @@ uint32_t avd_ckpt_app(AVD_CL_CB *cb, AVD
 
        osafassert (action == NCS_MBCSV_ACT_UPDATE);
 
-       AVD_APP *app = app_db->find(&ckpt_app->name);
+       AVD_APP *app = app_db->find(Amf::to_string(&ckpt_app->name));
        if (app == NULL) {
                LOG_ER("%s failed to find '%s'", __FUNCTION__, 
ckpt_app->name.value);
                rc = NCSCC_RC_FAILURE;
@@ -185,7 +185,7 @@ uint32_t avd_ckpt_su(AVD_CL_CB *cb, AVD_
 
        osafassert (action == NCS_MBCSV_ACT_UPDATE);
 
-       if (NULL == (su = su_db->find(&ckpt_su->name))) {
+       if (NULL == (su = su_db->find(Amf::to_string(&ckpt_su->name)))) {
                LOG_ER("su_db->find FAILED for '%s'", ckpt_su->name.value);
                rc = NCSCC_RC_FAILURE;
                goto done;
@@ -272,7 +272,7 @@ uint32_t avd_ckpt_su_oper_list(AVD_CL_CB
 
        TRACE_ENTER2("'%s'", ckpt_su->name.value);
 
-       su = su_db->find(&ckpt_su->name);
+       su = su_db->find(Amf::to_string(&ckpt_su->name));
        osafassert(su);
 
        if (NCS_MBCSV_ACT_ADD == action)
@@ -359,8 +359,8 @@ uint32_t avd_ckpt_si_trans(AVD_CL_CB *cb
        switch (action) {
        case NCS_MBCSV_ACT_ADD:
                sg_ptr->si_tobe_redistributed = 
avd_si_get(&si_trans_ckpt->si_name); 
-               sg_ptr->min_assigned_su = 
su_db->find(&si_trans_ckpt->min_su_name); 
-               sg_ptr->max_assigned_su = 
su_db->find(&si_trans_ckpt->max_su_name); 
+               sg_ptr->min_assigned_su = 
su_db->find(Amf::to_string(&si_trans_ckpt->min_su_name)); 
+               sg_ptr->max_assigned_su = 
su_db->find(Amf::to_string(&si_trans_ckpt->max_su_name)); 
                break;
 
        case NCS_MBCSV_ACT_RMV:
@@ -408,7 +408,7 @@ uint32_t avd_ckpt_siass(AVD_CL_CB *cb, A
 
        su_si_rel_ptr = avd_susi_find(cb, &su_si_ckpt->su_name, 
&su_si_ckpt->si_name);
 
-       su_ptr = su_db->find(&su_si_ckpt->su_name);
+       su_ptr = su_db->find(Amf::to_string(&su_si_ckpt->su_name));
        osafassert(su_ptr);
        si_ptr_up = avd_si_get(&su_si_ckpt->si_name);
        osafassert(si_ptr_up);
diff --git a/osaf/services/saf/amf/amfd/comp.cc 
b/osaf/services/saf/amf/amfd/comp.cc
--- a/osaf/services/saf/amf/amfd/comp.cc
+++ b/osaf/services/saf/amf/amfd/comp.cc
@@ -214,7 +214,7 @@ static void comp_add_to_model(AVD_COMP *
        }
 
        avsv_sanamet_init(&comp->comp_info.name, &dn, "safSu");
-       su = comp->su = su_db->find(&dn);
+       su = comp->su = su_db->find(Amf::to_string(&dn));
 
        avd_comp_db_add(comp);
        comp->comp_type = avd_comptype_get(&comp->saAmfCompType);
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
@@ -130,7 +130,7 @@ class AVD_SU {
        void operator=(const AVD_SU&);
 };
 
-extern AmfDb<AVD_SU> *su_db;
+extern AmfDb<std::string, AVD_SU> *su_db;
 
 /**
  * Get SUs from IMM and create internal objects
diff --git a/osaf/services/saf/amf/amfd/ndproc.cc 
b/osaf/services/saf/amf/amfd/ndproc.cc
--- a/osaf/services/saf/amf/amfd/ndproc.cc
+++ b/osaf/services/saf/amf/amfd/ndproc.cc
@@ -715,7 +715,7 @@ void avd_data_update_req_evh(AVD_CL_CB *
                }
        case AVSV_SA_AMF_SU:{
                        /* Find the component record in the database, specified 
in the message. */
-                       if ((su = 
su_db->find(&n2d_msg->msg_info.n2d_data_req.param_info.name)) == NULL) {
+                       if ((su = 
su_db->find(Amf::to_string(&n2d_msg->msg_info.n2d_data_req.param_info.name))) 
== NULL) {
                                LOG_ER("%s: Invalid SU '%s' (%u)", __FUNCTION__,
                                        
n2d_msg->msg_info.n2d_data_req.param_info.name.value,
                                        
n2d_msg->msg_info.n2d_data_req.param_info.name.length);
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
@@ -30,7 +30,7 @@
 #include <csi.h>
 #include <cluster.h>
 
-AmfDb<AVD_SU> *su_db = NULL;
+AmfDb<std::string, AVD_SU> *su_db = NULL;
 
 AVD_SU::AVD_SU(const SaNameT *dn):
                saAmfSURank(0),
@@ -80,7 +80,7 @@ void AVD_SU::remove_from_model() {
        m_AVSV_SEND_CKPT_UPDT_ASYNC_RMV(avd_cb, this, AVSV_CKPT_AVD_SU_CONFIG);
        avd_node_remove_su(this);
        avd_sutype_remove_su(this);
-       su_db->erase(this);
+       su_db->erase(Amf::to_string(&name));
        avd_sg_remove_su(this);
 
        TRACE_LEAVE();
@@ -95,12 +95,12 @@ void AVD_SU::remove_from_model() {
  */
 AVD_SU *avd_su_get_or_create(const SaNameT *dn)
 {
-       AVD_SU *su = su_db->find(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(su);
+               unsigned int rc = su_db->insert(Amf::to_string(&su->name), su);
                osafassert(rc == NCSCC_RC_SUCCESS);
        }
 
@@ -450,7 +450,7 @@ static AVD_SU *su_create(const SaNameT *
        ** If called at new active at failover, the object is found in the DB
        ** but needs to get configuration attributes initialized.
        */
-       if ((su = su_db->find(dn)) == NULL) {
+       if ((su = su_db->find(Amf::to_string(dn))) == NULL) {
                su = new AVD_SU(dn);
        } else
                TRACE("already created, refreshing config...");
@@ -585,7 +585,7 @@ static void su_add_to_model(AVD_SU *su)
        }
 
        /* Determine of the SU is added now, if so msg to amfnd needs to be 
sent */
-       if (su_db->find(&su->name) == NULL)
+       if (su_db->find(Amf::to_string(&su->name)) == NULL)
                new_su = true;
 
        avsv_sanamet_init(&su->name, &dn, "safSg");
@@ -598,7 +598,7 @@ static void su_add_to_model(AVD_SU *su)
        su->sg_of_su = avd_sg_get(&dn);
        osafassert(su->sg_of_su);
 
-       rc = su_db->insert(su);
+       rc = su_db->insert(Amf::to_string(&su->name), su);
        osafassert(rc == NCSCC_RC_SUCCESS);
        su->su_type = avd_sutype_get(&su->saAmfSUType);
        osafassert(su->su_type);
@@ -888,7 +888,7 @@ static void su_admin_op_cb(SaImmOiHandle
                goto done;
        }
 
-       if (NULL == (su = su_db->find(su_name))) {
+       if (NULL == (su = su_db->find(Amf::to_string(su_name)))) {
                LOG_CR("SU '%s' not found", su_name->value);
                /* internal error? osafassert instead? */
                goto done;
@@ -1203,7 +1203,7 @@ done:
 static SaAisErrorT su_rt_attr_cb(SaImmOiHandleT immOiHandle,
        const SaNameT *objectName, const SaImmAttrNameT *attributeNames)
 {
-       AVD_SU *su = su_db->find(objectName);
+       AVD_SU *su = su_db->find(Amf::to_string(objectName));
        SaImmAttrNameT attributeName;
        int i = 0;
 
@@ -1261,7 +1261,7 @@ static SaAisErrorT su_ccb_completed_modi
                        continue;
 
                if (!strcmp(attr_mod->modAttr.attrName, "saAmfSUFailover")) {
-                       AVD_SU *su = su_db->find(&opdata->objectName);
+                       AVD_SU *su = 
su_db->find(Amf::to_string(&opdata->objectName));
                        uint32_t su_failover = *((SaUint32T 
*)attr_mod->modAttr.attrValues[0]);
 
                        /* If SG is not in stable state and amfnd is already 
busy in the handling of some fault,
@@ -1281,7 +1281,7 @@ static SaAisErrorT su_ccb_completed_modi
                                goto done;
                        }
                } else if (!strcmp(attr_mod->modAttr.attrName, 
"saAmfSUMaintenanceCampaign")) {
-                       AVD_SU *su = su_db->find(&opdata->objectName);
+                       AVD_SU *su = 
su_db->find(Amf::to_string(&opdata->objectName));
 
                        if (su->saAmfSUMaintenanceCampaign.length > 0) {
                                report_ccb_validation_error(opdata, 
"saAmfSUMaintenanceCampaign already set for %s",
@@ -1292,7 +1292,7 @@ static SaAisErrorT su_ccb_completed_modi
                } else if (!strcmp(attr_mod->modAttr.attrName, "saAmfSUType")) {
                        AVD_SU *su;
                        SaNameT sutype_name = *(SaNameT*) 
attr_mod->modAttr.attrValues[0];
-                       su = su_db->find(&opdata->objectName);
+                       su = su_db->find(Amf::to_string(&opdata->objectName));
                        if(SA_AMF_ADMIN_LOCKED_INSTANTIATION != 
su->saAmfSUAdminState) {
                                report_ccb_validation_error(opdata, "SU is not 
in locked-inst, present state '%d'",
                                                su->saAmfSUAdminState);
@@ -1342,7 +1342,7 @@ static SaAisErrorT su_ccb_completed_dele
        if (strstr((char *)opdata->objectName.value, "safApp=OpenSAF") != NULL)
                is_app_su = 0;
 
-       su = su_db->find(&opdata->objectName);
+       su = su_db->find(Amf::to_string(&opdata->objectName));
        osafassert(su != NULL);
 
        if (is_app_su && (su->saAmfSUAdminState != 
SA_AMF_ADMIN_LOCKED_INSTANTIATION)) {
@@ -1446,7 +1446,7 @@ static void su_ccb_apply_modify_hdlr(str
 
        TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, 
opdata->objectName.value);
 
-       su = su_db->find(&opdata->objectName);
+       su = su_db->find(Amf::to_string(&opdata->objectName));
 
        while ((attr_mod = opdata->param.modify.attrMods[i++]) != NULL) {
                /* Attribute value removed */
@@ -1624,7 +1624,7 @@ void AVD_SU::dec_curr_stdby_si() {
 
 void avd_su_constructor(void)
 {
-       su_db = new AmfDb<AVD_SU>;
+       su_db = new AmfDb<std::string, AVD_SU>;
        avd_class_impl_set("SaAmfSU", su_rt_attr_cb, su_admin_op_cb,
                su_ccb_completed_cb, su_ccb_apply_cb);
 }

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to