Created
March 10, 2015 02:04
-
-
Save eventhelix/e9b58a09251a6721aaf6 to your computer and use it in GitHub Desktop.
Digital Trunk Class With Helper Classes http://www.eventhelix.com/realtimemantra/object_oriented/object_design_tips_2.htm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DigitTrunk | |
{ | |
Status m_status; | |
Timeslot m_timeslot[MAX_TIMESLOTS_PER_TRUNK]; | |
class SignalingHandler | |
{ | |
int m_signalingTimeslot; | |
int m_signalingStatus; | |
. . . | |
public: | |
void HandleSignalingRequest(); | |
void SendSignalingIndication(); | |
}; | |
class ErrorHandler | |
{ | |
int m_errorThreshold; | |
int m_localErrorRate; | |
int m_remoteErrorRate; | |
. . . | |
public: | |
void HandleRemoteError(); | |
void HandleLocalError(); | |
}; | |
// Helper classes | |
SignalingHandler m_signalingHandler; | |
ErrorHandler m_errorHandler; | |
public: | |
. . . | |
void HandleSignalingRequest() | |
{ m_sigalingHandler.HandleSignalingRequest(); } | |
void SendSignalingIndication() | |
{ m_signalingHandler.SendSignalingIndication(); } | |
. . . | |
void HandleRemoteError() | |
{ m_errorHandler.HandleRemoteError(); } | |
void HandleLocalError() | |
{ m_errorHandler.HandleLocalError(); } | |
. . . | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment