ack/Regards HansN On 06/11/14 07:37, Gary Lee wrote: > osaf/services/saf/amf/amfd/include/si.h | 14 +++-- > osaf/services/saf/amf/amfd/sgproc.cc | 2 +- > osaf/services/saf/amf/amfd/si.cc | 80 > ++++++++++++++++---------------- > osaf/services/saf/amf/amfd/siass.cc | 22 ++++---- > 4 files changed, 60 insertions(+), 58 deletions(-) > > > Convert various increment and decrement static functions > to class member functions. > > diff --git a/osaf/services/saf/amf/amfd/include/si.h > b/osaf/services/saf/amf/amfd/include/si.h > --- a/osaf/services/saf/amf/amfd/include/si.h > +++ b/osaf/services/saf/amf/amfd/include/si.h > @@ -110,6 +110,13 @@ public: > > bool alarm_sent; /* SI unassigned alarm has been sent */ > > + void inc_curr_act_ass(); > + void dec_curr_act_ass(); > + void inc_curr_stdby_ass(); > + void dec_curr_stdby_ass(); > + void inc_curr_stdby_dec_act_ass(); > + void inc_curr_act_dec_std_ass(); > + > private: > AVD_SI(const AVD_SI&); > AVD_SI& operator=(const AVD_SI&); > @@ -167,12 +174,7 @@ extern void avd_svctype_constructor(void > > extern SaAisErrorT avd_svctypecstypes_config_get(SaNameT *svctype_name); > extern void avd_svctypecstypes_constructor(void); > -extern void avd_si_inc_curr_act_ass(AVD_SI *si); > -extern void avd_si_dec_curr_act_ass(AVD_SI *si); > -extern void avd_si_inc_curr_stdby_ass(AVD_SI *si); > -extern void avd_si_dec_curr_stdby_ass(AVD_SI *si); > -extern void avd_si_inc_curr_stdby_dec_act_ass(AVD_SI *si); > -extern void avd_si_inc_curr_act_dec_std_ass(AVD_SI *si); > + > extern void avd_si_admin_state_set(AVD_SI* si, SaAmfAdminStateT state); > extern void avd_si_assignments_delete(AVD_CL_CB *cb, AVD_SI *si); > extern void avd_si_add_rankedsu(AVD_SI *si, const SaNameT *suname, uint32_t > saAmfRank); > diff --git a/osaf/services/saf/amf/amfd/sgproc.cc > b/osaf/services/saf/amf/amfd/sgproc.cc > --- a/osaf/services/saf/amf/amfd/sgproc.cc > +++ b/osaf/services/saf/amf/amfd/sgproc.cc > @@ -329,7 +329,7 @@ static uint32_t sg_su_failover_func(AVD_ > saAmfSINumCurrActiveAssignments was > increased when active > assignment had been sent. So decrement the > count in SI before > deleting the SUSI. */ > - avd_si_dec_curr_act_ass(susi->si); > + susi->si->dec_curr_act_ass(); > } > /* Reply to IMM for admin operation on SI */ > if (susi->si->invocation != 0) { > 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 > @@ -1301,66 +1301,66 @@ static void si_update_ass_state(AVD_SI * > } > } > > -void avd_si_inc_curr_act_ass(AVD_SI *si) > +void AVD_SI::inc_curr_act_ass() > { > - si->saAmfSINumCurrActiveAssignments++; > - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, si, > AVSV_CKPT_SI_SU_CURR_ACTIVE); > - TRACE("%s saAmfSINumCurrActiveAssignments=%u", si->name.value, > si->saAmfSINumCurrActiveAssignments); > - si_update_ass_state(si); > + saAmfSINumCurrActiveAssignments++; > + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, > AVSV_CKPT_SI_SU_CURR_ACTIVE); > + TRACE("%s saAmfSINumCurrActiveAssignments=%u", name.value, > saAmfSINumCurrActiveAssignments); > + si_update_ass_state(this); > } > > -void avd_si_dec_curr_act_ass(AVD_SI *si) > +void AVD_SI::dec_curr_act_ass() > { > - osafassert(si->saAmfSINumCurrActiveAssignments > 0); > - si->saAmfSINumCurrActiveAssignments--; > - TRACE("%s saAmfSINumCurrActiveAssignments=%u", si->name.value, > si->saAmfSINumCurrActiveAssignments); > - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, si, > AVSV_CKPT_SI_SU_CURR_ACTIVE); > - si_update_ass_state(si); > + osafassert(saAmfSINumCurrActiveAssignments > 0); > + saAmfSINumCurrActiveAssignments--; > + TRACE("%s saAmfSINumCurrActiveAssignments=%u", name.value, > saAmfSINumCurrActiveAssignments); > + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, > AVSV_CKPT_SI_SU_CURR_ACTIVE); > + si_update_ass_state(this); > } > > -void avd_si_inc_curr_stdby_ass(AVD_SI *si) > +void AVD_SI::inc_curr_stdby_ass() > { > - si->saAmfSINumCurrStandbyAssignments++; > - TRACE("%s saAmfSINumCurrStandbyAssignments=%u", si->name.value, > si->saAmfSINumCurrStandbyAssignments); > - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, si, AVSV_CKPT_SI_SU_CURR_STBY); > - si_update_ass_state(si); > + saAmfSINumCurrStandbyAssignments++; > + TRACE("%s saAmfSINumCurrStandbyAssignments=%u", name.value, > saAmfSINumCurrStandbyAssignments); > + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, > AVSV_CKPT_SI_SU_CURR_STBY); > + si_update_ass_state(this); > } > > -void avd_si_dec_curr_stdby_ass(AVD_SI *si) > +void AVD_SI::dec_curr_stdby_ass() > { > - osafassert(si->saAmfSINumCurrStandbyAssignments > 0); > - si->saAmfSINumCurrStandbyAssignments--; > - TRACE("%s saAmfSINumCurrStandbyAssignments=%u", si->name.value, > si->saAmfSINumCurrStandbyAssignments); > - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, si, AVSV_CKPT_SI_SU_CURR_STBY); > - si_update_ass_state(si); > + osafassert(saAmfSINumCurrStandbyAssignments > 0); > + saAmfSINumCurrStandbyAssignments--; > + TRACE("%s saAmfSINumCurrStandbyAssignments=%u", name.value, > saAmfSINumCurrStandbyAssignments); > + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, > AVSV_CKPT_SI_SU_CURR_STBY); > + si_update_ass_state(this); > } > > -void avd_si_inc_curr_act_dec_std_ass(AVD_SI *si) > +void AVD_SI::inc_curr_act_dec_std_ass() > { > - si->saAmfSINumCurrActiveAssignments++; > - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, si, > AVSV_CKPT_SI_SU_CURR_ACTIVE); > - TRACE("%s saAmfSINumCurrActiveAssignments=%u", si->name.value, > si->saAmfSINumCurrActiveAssignments); > + saAmfSINumCurrActiveAssignments++; > + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, > AVSV_CKPT_SI_SU_CURR_ACTIVE); > + TRACE("%s saAmfSINumCurrActiveAssignments=%u", name.value, > saAmfSINumCurrActiveAssignments); > > - osafassert(si->saAmfSINumCurrStandbyAssignments > 0); > - si->saAmfSINumCurrStandbyAssignments--; > - TRACE("%s saAmfSINumCurrStandbyAssignments=%u", si->name.value, > si->saAmfSINumCurrStandbyAssignments); > - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, si, > AVSV_CKPT_SI_SU_CURR_STBY); > + osafassert(saAmfSINumCurrStandbyAssignments > 0); > + saAmfSINumCurrStandbyAssignments--; > + TRACE("%s saAmfSINumCurrStandbyAssignments=%u", name.value, > saAmfSINumCurrStandbyAssignments); > + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, > AVSV_CKPT_SI_SU_CURR_STBY); > > - si_update_ass_state(si); > + si_update_ass_state(this); > } > > -void avd_si_inc_curr_stdby_dec_act_ass(AVD_SI *si) > +void AVD_SI::inc_curr_stdby_dec_act_ass() > { > - si->saAmfSINumCurrStandbyAssignments++; > - TRACE("%s saAmfSINumCurrStandbyAssignments=%u", si->name.value, > si->saAmfSINumCurrStandbyAssignments); > - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, si, > AVSV_CKPT_SI_SU_CURR_STBY); > + saAmfSINumCurrStandbyAssignments++; > + TRACE("%s saAmfSINumCurrStandbyAssignments=%u", name.value, > saAmfSINumCurrStandbyAssignments); > + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, > AVSV_CKPT_SI_SU_CURR_STBY); > > - osafassert(si->saAmfSINumCurrActiveAssignments > 0); > - si->saAmfSINumCurrActiveAssignments--; > - TRACE("%s saAmfSINumCurrActiveAssignments=%u", si->name.value, > si->saAmfSINumCurrActiveAssignments); > - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, si, > AVSV_CKPT_SI_SU_CURR_ACTIVE); > + osafassert(saAmfSINumCurrActiveAssignments > 0); > + saAmfSINumCurrActiveAssignments--; > + TRACE("%s saAmfSINumCurrActiveAssignments=%u", name.value, > saAmfSINumCurrActiveAssignments); > + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, > AVSV_CKPT_SI_SU_CURR_ACTIVE); > > - si_update_ass_state(si); > + si_update_ass_state(this); > } > > void avd_si_constructor(void) > diff --git a/osaf/services/saf/amf/amfd/siass.cc > b/osaf/services/saf/amf/amfd/siass.cc > --- a/osaf/services/saf/amf/amfd/siass.cc > +++ b/osaf/services/saf/amf/amfd/siass.cc > @@ -408,10 +408,10 @@ uint32_t avd_susi_delete(AVD_CL_CB *cb, > } else if ((susi->fsm == AVD_SU_SI_STATE_ASGND) || (susi->fsm > == AVD_SU_SI_STATE_ASGN)){ > if (SA_AMF_HA_STANDBY == susi->state) { > su->dec_curr_stdby_si(); > - avd_si_dec_curr_stdby_ass(susi->si); > + susi->si->dec_curr_stdby_ass(); > } else if ((SA_AMF_HA_ACTIVE == susi->state) || > (SA_AMF_HA_QUIESCING == susi->state)) { > su->dec_curr_act_si(); > - avd_si_dec_curr_act_ass(susi->si); > + susi->si->dec_curr_act_ass(); > } > } > } > @@ -606,10 +606,10 @@ void avd_susi_update_assignment_counters > case AVSV_SUSI_ACT_ASGN: > if (new_ha_state == SA_AMF_HA_ACTIVE) { > su->inc_curr_act_si(); > - avd_si_inc_curr_act_ass(susi->si); > + susi->si->inc_curr_act_ass(); > } else if (new_ha_state == SA_AMF_HA_STANDBY) { > su->inc_curr_stdby_si(); > - avd_si_inc_curr_stdby_ass(susi->si); > + susi->si->inc_curr_stdby_ass(); > } > break; > case AVSV_SUSI_ACT_MOD: > @@ -617,35 +617,35 @@ void avd_susi_update_assignment_counters > /* standby to active */ > su->inc_curr_act_si(); > su->dec_curr_stdby_si(); > - avd_si_inc_curr_act_dec_std_ass(susi->si); > + susi->si->inc_curr_act_dec_std_ass(); > } else if (((current_ha_state == SA_AMF_HA_ACTIVE) || > (current_ha_state == SA_AMF_HA_QUIESCING)) > && (new_ha_state == SA_AMF_HA_QUIESCED)) { > /* active or quiescing to quiesced */ > su->dec_curr_act_si(); > - avd_si_dec_curr_act_ass(susi->si); > + susi->si->dec_curr_act_ass(); > } else if ((current_ha_state == SA_AMF_HA_QUIESCED) && > (new_ha_state == SA_AMF_HA_STANDBY)) { > /* active or quiescinf to standby */ > su->inc_curr_stdby_si(); > - avd_si_inc_curr_stdby_ass(susi->si); > + susi->si->inc_curr_stdby_ass(); > } else if (((current_ha_state == SA_AMF_HA_ACTIVE) || > (current_ha_state == SA_AMF_HA_QUIESCING)) > && (new_ha_state == SA_AMF_HA_STANDBY)) { > /* active or quiescinf to standby */ > su->dec_curr_act_si(); > su->inc_curr_stdby_si(); > - avd_si_inc_curr_stdby_dec_act_ass(susi->si); > + susi->si->inc_curr_stdby_dec_act_ass(); > } else if ((current_ha_state == SA_AMF_HA_QUIESCED) && > (new_ha_state == SA_AMF_HA_ACTIVE)) { > /* quiescing to active */ > su->inc_curr_act_si(); > - avd_si_inc_curr_act_ass(susi->si); > + susi->si->inc_curr_act_ass(); > } > break; > case AVSV_SUSI_ACT_DEL: > if (susi->state == SA_AMF_HA_STANDBY) { > su->dec_curr_stdby_si(); > - avd_si_dec_curr_stdby_ass(susi->si); > + susi->si->dec_curr_stdby_ass(); > } else if ((susi->state == SA_AMF_HA_ACTIVE) || (susi->state == > SA_AMF_HA_QUIESCING)) { > su->dec_curr_act_si(); > - avd_si_dec_curr_act_ass(susi->si); > + susi->si->dec_curr_act_ass(); > } > break; > default:
------------------------------------------------------------------------------ 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