Previous | Contents | Index |
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();
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 pszFacilityName, const size_t uiFacilityNameSize);
rtr_status_t
pszFacilityName
A pointer to a facility name.uiFacilityNameSize
An unsigned integer for the facility name size.
Retrieve the name of the facility member.
#define MAX_FACNAME 256 char szFacName[MAX_FACNAME]; rtr_status_t stsGetName = FacMember.GetName(szFacName, MAX_FACNAME); 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;
bool Remove (const size_t n);
True or False
n
The element in the array (ar[0] is the first element). The element is a pointer to an object.
This method removes the Nth element of the array. This does not destroy the object pointed to; the caller must delete the contents.
bool bArrayRemoveStatus; bArrayRemoveStatus = ar.Remove(1); if (IsFailure(bArrayRemoveStatus)) { cout << " RTRFacilityMemberArray::Remove failed\n"; } return bArrayRemoveStatus;
RTRFacilityMemberArray(); virtual ~RTRFacilityMemberArray;
None
None
Construct an RTRFacilityMemberArray object.
RTRFacilityMemberArray::RTRFacilityMemberArray() { }
size_t Size() const;
size_t
None
The method returns the number of elements in the array.
size_t nArraySize = ar.Size(); if (IsFailure(nArraySize == 1)) { cout << " RTRFacilityMemberArray::Size failed\n"; } return nArraySize == 1;
Construction
Method | Description |
---|---|
RTRFacilityProperties(rtr_const_facnam_t) | Constructor |
~RTRFacilityProperties | Destructor |
Operations
Method | Description |
---|---|
GetMemberList(RTRFacilityMemberArray) | Retrieves a list of nodes and their roles for an existing facility. |
SetBalance(bool) | Allows intelligent reconnection of frontend to routers according to the number of connections on each active router. |
Previous | Next | Contents | Index |