I have three objects in a class (channelManager) that i need to call in my main class in order to output a message but i can't seem to know how since i'm not a c++ expert. I think my porblem is that i don't really understand the arguments of these three objects:
void ChannelManager::setOutputStream(std::ostream* stream) {
m_output_stream = stream;
}
void ChannelManager::outputMessage(string ip, string message){
if (m_output_stream != NULL) {
(*m_output_stream) << message;
}
if (m_message_callback != NULL) {
m_message_callback(ip, message);
}
}
void ChannelManager::setMessageCallback(function<void(string, string)> message_callback) {
m_message_callback = message_callback;
}
mainly, i want to create three functions in order to be able to call these objects to output the message.
if anyone asks i can provide the code of my main class.