C#-like events in C++, Composition
<p>For the last couple of months I've been using C# a lot and got used to events and delegates. Its is very easy to use composition in your classes, just use events to get messages from the component... Now I'm trying to do something similar in C++ and don't know how to do it. </p>

<p>How is composition done in C++? The only way that comes to my mind is inheritance... you derive from the class and override its functions to receive input from it? Is there any other easier (better) way?</p>

<p>To further explain... </p>

<p>I want to write a reusable component like this...</p>

<pre><code>public delegate void OnDataReceivedHanlder(byte[] data);
public class TcpConnection
{
    public void Connect(string iP, ushort port);
    public void Send(byte[] data);
    public event OnDataReceivedHandler OnDataReceived;    
}
</code></pre>

<p>in C++...</p>
