Previous | Contents | Index |
rtr_status_t RemoveBackend( rtr_const_facnam_t pszFacilityName, rtr_const_nodnam_t pszBackend );
rtr_status_t Interpret value for the success or failure of this call.
pszFacilityName
A null-terminated pointer to a facility name.pszBackend
A null-terminated pointer to a facility member with a backend (BE) role.
Call this method to remove backend node from a facility.
rtr_status_t sStatus; char *pszFacilityName = "MyFacilityName"; char *pszNodeName = "BENodeNamesSeparatedbyComma"; sStatus = myFac->RemoveBackend(pszFacilityName,pszNodeName);
rtr_status_t RemoveFrontend( rtr_const_facnam_t pszFacilityName, rtr_const_nodnam_t pszFrontend );
rtr_status_t Interpret value for the success or failure of this call.
pszFacilityName
A null-terminated pointer to a facility name.pszFrontend
A null-terminated pointer to a facility member with a frontend (FE) role.
Call this method to remove frontend nodes from a facility.
rtr_status_t sStatus; char *pszFacilityName = "MyFacilityName"; char *pszNodeName = "FENodeNamesSeparatedbyComma"; sStatus = myFac-> RemoveFrontend (pszFacilityName,pszNodeName);
rtr_status_t RemoveRouter( rtr_const_facnam_t pszFacilityName, rtr_const_nodnam_t pszRouter );
rtr_status_t Interpret value for the success or failure of this call.
pszFacilityName
A null-terminated pointer to a facility name.pszRouter
A null-terminated pointer to a facility member with a router (TR) role.
Call this method to remove router nodes from a facility.
rtr_status_t sStatus; char *pszFacilityName = "MyFacilityName"; char *pszNodeName = "TRNodeNamesSeparatedbyComma"; sStatus = myFac-> RemoveRouter (pszFacilityName,pszNodeName);
RTRFacilityManager(); virtual ~RTRFacilityManager();
None
None
Use this method to declare a facility manager object. Facility manager object should be declared for accessing any properties of a facility.
RTRFacilityManager *myFac = new RTRFacilityManager();
4.4 RTRFacilityMember
RTRFacilityMember provides members that can retrieve information about
facilities including member name, role of the member, connectivity to
or property of being the local node.
Construction
Method | Description |
---|---|
RTRFacilityMember(rtr_const_facnam_t, rtr_const_nodnam_t, const eRTRMemberRoleType) | Constructor |
~RTRFacilityMember() | Destructor |
Operations
Method | Description |
---|---|
GetName(rtr_facnam_t, const size_t) | Retrieve the name of the facility member. |
HasBackendRole(bool) | Determine if this facility member has a backend role. |
HasFrontendRole(bool) | Determine if this facility member has a frontend role. |
HasRouterRole(bool) | Determine if this facility member has a router role. |
IsConnectedToLocalNode(bool) | Determine if this facility member has connectivity to the local node. |
IsLocalNode(bool) | Determine if this facility is the local node. |
rtr_status_t GetName( rtr_facnam_t pszNodeName, const size_t uiNodeNameSize);
rtr_status_t
pszNodeName
A pointer to a nodename.uiNodeNameSize
An unsigned integer for the member name (nodename) size.
Retrieve the name of the nodename, the facility member.
#define MAX_NODNAME 256 char szNodName[MAX_NODNAME]; rtr_status_t stsGetName = FacMember.GetName(szNodName, MAX_NODNAME); if (IsFailure(stsGetName == RTR_STS_OK)) { cout << " RTRFacilityMember::GetName failed\n"; OutputStatus(stsGetName); } else {...
rtr_status_t HasBackendRole(bool &bHasRole);
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
bHasRole
A boolean that is true or false for HasBackendRole.
Call this method to find out a node is configured as backend.
rtr_status_t stsHasRole; bool bHasRole; stsHasRole = FacMember.HasBackendRole(bHasRole); if ( IsFailure( stsHasRole == RTR_STS_OK ) ) { bOverallResult = false; OutputStatus( stsHasRole ); } bOverallResult = (bHasRole == true);
rtr_status_t HasFrontendRole(bool &bHasRole);
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
bHasRole
A boolean that is true or false for HasFrontendRole.
Call this method to find out if a node is configured as frontend.
rtr_status_t stsHasRole; bool bHasRole; stsHasRole = FacMember.HasFrontendRole(bHasRole); if ( IsFailure( stsHasRole == RTR_STS_OK ) ) { bOverallResult = false; OutputStatus( stsHasRole ); } bOverallResult = (bHasRole == true);
rtr_status_t HasRouterRole(bool &bHasRole);
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
bHasRole
A boolean that is true or false for HasRouterRole.
Call this method to find out if a node is configured as router.
rtr_status_t stsHasRole; bool bHasRole; stsHasRole = FacMember.HasRouterRole(bHasRole); if ( IsFailure( stsHasRole == RTR_STS_OK ) ) { bOverallResult = false; OutputStatus( stsHasRole ); } bOverallResult = (bHasRole == true);
rtr_status_t IsConnectedToLocalNode(bool &bIsConnected);
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
bIsConnected
A boolean that is true if the node is connected to the local node.
Call this method to find out if this node is connected to the local node.
bool bIsConnected; rtr_status_t stsIsConnected; stsIsConnected = FacMember.IsConnectedToLocalNode(bIsConnected); if (IsFailure(stsIsConnected == RTR_STS_OK)) { OutputStatus(stsIsConnected); bOverallResult = false; } if (IsFailure(bIsConnected == true)) { cout << " RTRFacilityMember::IsConnectedToLocalNode failed\n"; bOverallResult = false; }
rtr_status_t IsLocalNode(bool &bIsLocal);
rtr_status_t Interpret value for the success or failure of this call. RTR_STS_OK is the normal successful completion.
bIsLocal
A boolean that is true if the node is a local node.
Call this method to find out if the node is a local node.
rtr_status_t stsIsLocal; bool bIsLocalNode; stsIsLocal = FacMember.IsLocalNode(bIsLocalNode); if (IsFailure(stsIsLocal == RTR_STS_OK)) { OutputStatus(stsIsLocal); bOverallResult = false; } if (IsFailure(bIsLocalNode == true)) { cout << " RTRFacilityMember::IsLocalNode failed\n"; bOverallResult = false; }
RTRFacilityMember( rtr_const_facnam_t pszFacilityName, rtr_const_nodnam_t pszMemberName); virtual ~RTRFacilityMember();
None
pszFacilityName
A null-terminated pointer to a facility name.pszMemberName
A null-terminated string pointer to the name of a facility member.
Call this method to declare a facility member object. The member role type can be:
- 1 (RTRFacilityBackend)
- 2 (RTRFacilityRouter)
- 3 (RTRFacilityFrontend)
Char *pszFac = "Myfacility"; Char *pszNode ="NodeName"; RTRFacilityMember *FacilityMember = new RTRFacilityMember(pszFac,pszNode);
4.5 RTRFacilityMemberArray
An RTRFacilityMemberArray object contains pointers to array elements.
The RTRFacilityMemberArray class requires the holder of the array to clean up the objects pointed to by the elements of the array. The array does not clean up these objects. |
Construction
Method | Description |
---|---|
RTRFacilityMemberArray() | Constructor |
~RTRFacilityMemberArray() | Destructor |
Operations
Method | Description |
---|---|
Add(RTRFacilityMember) | Adds a pointer to an RTRFacility member to the array. |
Clear() | Clears elements of the array. |
Insert(size_t, RTRFacilityMember) | Inserts a pointer to an RTRFacility member. |
operator[] (size_t) | Returns an element of the array which is a pointer to an RTRFacility member. |
Remove(const size_t) | Removes an element of the array. |
Size(const) | Returns the number of elements in the array. |
bool Add(RTRFacilityMember* pFacMember);
True or False
pFacMember
A pointer to a facility member.
Add a member to a facility member array by adding a pointer to an RTRFacility member. The caller is responsible for creating and destroying the actual object. The array destructor does not destroy the objects pointed to.
bool RTRFacilityMemberArray::Add() { bool bArrayAddStatus; RTRFacilityMemberArray ar; RTRFacilityMember* pFacMember; pFacMember = new RTRFacilityMember(GetDefaultFacilityName(), GetDefaultRouterName()); if (IsFailure(pFacMember != NULL)) { cout << " new RTRFacilityMember failed.\n"; return false; } bArrayAddStatus = ar.Add(pFacMember); if (IsFailure(bArrayAddStatus)) { cout << " RTRFacilityMemberArray::Add failed\n"; } return bArrayAddStatus; }
bool Clear();
True or False
None
This method clears the elements of the array, resulting in the array having a size of zero. This method does not destroy the objects pointed to; the caller must delete the contents.
bool bArrayClearStatus = ar.Clear(); if (IsFailure(bArrayClearStatus)) { cout << " RTRFacilityMemberArray::Clear failed\n"; } return bArrayClearStatus;
bool Insert(size_t n, RTRFacilityMember* pFacMember);
True or False
n
The element in the array ( ar[0] is the first element). The element is a pointer to an object.pFacMember
A pointer to a facility member.
This method inserts a pointer to an RTRFacility member into the nth position, moving the remainder of the array to make room.
bool bArrayInsertStatus; bArrayInsertStatus = ar.Insert(1, pFacMember); if (IsFailure(bArrayInsertStatus)) { cout << " RTRFacilityMemberArray::Insert failed\n"; } return bArrayInsertStatus;
RTRFacilityMember*& operator[] (size_t n);
Pointer to the nth element of the array.
n
The element in the array (ar[0] is the first element). The element is a pointer to an object.
This operator returns the nth element of the array which is a pointer to an RTRFacility member. You can also use this operator to set the nth element of the array.The existing element pointed to is not destroyed; the caller must delete the contents.
RTRFacilityMemberArray array; RTRFacilityMember* pFacMember; pFacMember = array; if (IsFailure(pFacMember != NULL)) { cout << " RTRFacilityMemberArray operator[] failed\n"; } return pFacMember != NULL;
Previous | Next | Contents | Index |