I have these Enum declarations:
enum MessageType{
REQ_LOGIN,
REQ_GET_FIELD,
RES_LOGIN,
RES_GET_FIELD
}
enum Request{
REQ_LOGIN,
REQ_GET_FIELD
};
enum Respond{
RES_LOGIN,
RES_GET_FIELD
};
Obviously I'm repeating elements in Enum's. Is there any way to prevent this?
EDIT: I'm using "MessageType" on a general purpose class to send it through network, on the other side I parse the object of this class and dispatch message. But I have different clients; some expects only objects with "Request" type member and some expects only objects with "Response" type member.
Using "Message" class, I'm creating "DispatcherRequest"s.
class Message
{
public:
……….
MessageType messageType;
}
struct DispatcherRequest
{
..........
Request type;
};