Ack Thanks -Nagu
> -----Original Message----- > From: Gary Lee [mailto:[email protected]] > Sent: 03 July 2014 07:16 > To: Nagendra Kumar; [email protected]; > [email protected]; Praveen Malviya > Cc: [email protected] > Subject: [PATCH 1 of 1] amfd: Change various AVD_APP functions to member > functions [#713] > > osaf/services/saf/amf/amfd/app.cc | 40 > +++++++++++++------------------ > osaf/services/saf/amf/amfd/include/app.h | 9 ++++--- > osaf/services/saf/amf/amfd/sg.cc | 4 +- > osaf/services/saf/amf/amfd/si.cc | 4 +- > 4 files changed, 26 insertions(+), 31 deletions(-) > > > diff --git a/osaf/services/saf/amf/amfd/app.cc > b/osaf/services/saf/amf/amfd/app.cc > --- a/osaf/services/saf/amf/amfd/app.cc > +++ b/osaf/services/saf/amf/amfd/app.cc > @@ -86,21 +86,18 @@ done: > TRACE_LEAVE(); > } > > -void avd_app_add_si(AVD_APP *app, AVD_SI *si) > +void AVD_APP::add_si(AVD_SI *si) > { > - si->si_list_app_next = si->app->list_of_si; > - si->app->list_of_si = si; > + si->si_list_app_next = list_of_si; > + list_of_si = si; > } > > -void avd_app_remove_si(AVD_APP *app, AVD_SI *si) > +void AVD_APP::remove_si(AVD_SI *si) > { > AVD_SI *i_si; > AVD_SI *prev_si = NULL; > > - if (!app) > - return; > - > - i_si = app->list_of_si; > + i_si = list_of_si; > > while ((i_si != NULL) && (i_si != si)) { > prev_si = i_si; > @@ -112,7 +109,7 @@ void avd_app_remove_si(AVD_APP *app, AVD > osafassert(0); > } else { > if (prev_si == NULL) { > - app->list_of_si = si->si_list_app_next; > + list_of_si = si->si_list_app_next; > } else { > prev_si->si_list_app_next = si->si_list_app_next; > } > @@ -122,24 +119,21 @@ void avd_app_remove_si(AVD_APP *app, AVD > si->app = NULL; > } > > -void avd_app_add_sg(AVD_APP *app, AVD_SG *sg) > +void AVD_APP::add_sg(AVD_SG *sg) > { > - sg->sg_list_app_next = app->list_of_sg; > - app->list_of_sg = sg; > - app->saAmfApplicationCurrNumSGs++; > + sg->sg_list_app_next = list_of_sg; > + list_of_sg = sg; > + saAmfApplicationCurrNumSGs++; > if (avd_cb->avd_peer_ver < AVD_MBCSV_SUB_PART_VERSION_4) > - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, app, > AVSV_CKPT_AVD_APP_CONFIG); > + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, > AVSV_CKPT_AVD_APP_CONFIG); > } > > -void avd_app_remove_sg(AVD_APP *app, AVD_SG *sg) > +void AVD_APP::remove_sg(AVD_SG *sg) > { > AVD_SG *i_sg; > AVD_SG *prev_sg = NULL; > > - if (!app) > - return; > - > - i_sg = app->list_of_sg; > + i_sg = list_of_sg; > > while ((i_sg != NULL) && (i_sg != sg)) { > prev_sg = i_sg; > @@ -151,16 +145,16 @@ void avd_app_remove_sg(AVD_APP *app, AVD > osafassert(0); > } else { > if (prev_sg == NULL) { > - app->list_of_sg = sg->sg_list_app_next; > + list_of_sg = sg->sg_list_app_next; > } else { > prev_sg->sg_list_app_next = sg->sg_list_app_next; > } > } > > - osafassert(app->saAmfApplicationCurrNumSGs > 0); > - app->saAmfApplicationCurrNumSGs--; > + osafassert(saAmfApplicationCurrNumSGs > 0); > + saAmfApplicationCurrNumSGs--; > if (avd_cb->avd_peer_ver < AVD_MBCSV_SUB_PART_VERSION_4) > - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, app, > AVSV_CKPT_AVD_APP_CONFIG); > + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, > AVSV_CKPT_AVD_APP_CONFIG); > sg->sg_list_app_next = NULL; > sg->app = NULL; > } > diff --git a/osaf/services/saf/amf/amfd/include/app.h > b/osaf/services/saf/amf/amfd/include/app.h > --- a/osaf/services/saf/amf/amfd/include/app.h > +++ b/osaf/services/saf/amf/amfd/include/app.h > @@ -47,6 +47,11 @@ public: > AVD_APP(); > AVD_APP(const SaNameT *dn); > ~AVD_APP(); > + > + void add_si(AVD_SI *si); > + void remove_si(AVD_SI *si); > + void add_sg(AVD_SG *sg); > + void remove_sg(AVD_SG *sg); > > private: > AVD_APP(const AVD_APP&); > @@ -55,10 +60,6 @@ private: > > extern AmfDb<std::string, AVD_APP> *app_db; > > -extern void avd_app_add_si(AVD_APP *app, AVD_SI *si); > -extern void avd_app_remove_si(AVD_APP *app, AVD_SI *si); > -extern void avd_app_add_sg(AVD_APP *app, AVD_SG *sg); > -extern void avd_app_remove_sg(AVD_APP *app, AVD_SG *sg); > extern SaAisErrorT avd_app_config_get(void); > extern void avd_app_constructor(void); > > diff --git a/osaf/services/saf/amf/amfd/sg.cc > b/osaf/services/saf/amf/amfd/sg.cc > --- a/osaf/services/saf/amf/amfd/sg.cc > +++ b/osaf/services/saf/amf/amfd/sg.cc > @@ -68,7 +68,7 @@ static void sg_add_to_model(AVD_SG *sg) > sg->sg_type = sgtype_db->find(Amf::to_string(&sg->saAmfSGType)); > osafassert(sg->sg_type); > avd_sgtype_add_sg(sg); > - avd_app_add_sg(sg->app, sg); > + sg->app->add_sg(sg); > > /* SGs belonging to a magic app will be NCS, TODO Better name! */ > if (!strcmp((char *)dn.value, "safApp=OpenSAF")) > @@ -86,7 +86,7 @@ done: > static void sg_remove_from_model(AVD_SG *sg) > { > avd_sgtype_remove_sg(sg); > - avd_app_remove_sg(sg->app, sg); > + sg->app->remove_sg(sg); > sg_db->erase(Amf::to_string(&sg->name)); > > m_AVSV_SEND_CKPT_UPDT_ASYNC_RMV(avd_cb, sg, > AVSV_CKPT_AVD_SG_CONFIG); > diff --git a/osaf/services/saf/amf/amfd/si.cc > b/osaf/services/saf/amf/amfd/si.cc > --- a/osaf/services/saf/amf/amfd/si.cc > +++ b/osaf/services/saf/amf/amfd/si.cc > @@ -373,7 +373,7 @@ void avd_si_delete(AVD_SI *si) > si->delete_csis(); > m_AVSV_SEND_CKPT_UPDT_ASYNC_RMV(avd_cb, si, > AVSV_CKPT_AVD_SI_CONFIG); > avd_svctype_remove_si(si); > - avd_app_remove_si(si->app, si); > + si->app->remove_si(si); > avd_sg_remove_si(si->sg_of_si, si); > > // clear any pending alarms for this SI > @@ -456,7 +456,7 @@ void AVD_SI::si_add_to_model() > sg_of_si = sg_db- > >find(Amf::to_string(&saAmfSIProtectedbySG)); > > avd_svctype_add_si(this); > - avd_app_add_si(app, this); > + app->add_si(this); > avd_sg_add_si(sg_of_si, this); > m_AVSV_SEND_CKPT_UPDT_ASYNC_ADD(avd_cb, this, > AVSV_CKPT_AVD_SI_CONFIG); > avd_saImmOiRtObjectUpdate(&name, "saAmfSIAssignmentState", ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
