Is this possible?
What I want to do is have a Type TConnection that owns a type TProtocol object. Of course, this requires TConnection to know about TProtocol, and so I have to import the TProtocol.bmx file.
I'd also like the protocol itself to have a 'pointer' (well a TConnection object that is set to its owner) back to it's owner TConnection object so that it can transfer data back to it without invoking any functions from the TConnection itself. This requires that TProtocol knows about TConnection, though.
To summarize
TConnection owns a TProtocol object
Each TProtocol needs to know about it's owner TConnection object.
Is there any way to do this while keeping the files separate? I wish I could just "Declare" TConnection within the TProtocol file, but it doesn't seem there is a way. I tried using
extern Type TConnection
EndType
endextern
at the top of the file, just to see, but no luck. Everything else has understandably resulted in a duplicate identifier error.
I realize I can alter the design to have the TConnection object handle everything related to it's TProtocol object, but really, the TProtocol object needs to be as autonomous as possible. Given that, I'd prefer not to have to alter the design.
Hopefully there's a simple fix that I'm missing.
What I want to do is have a Type TConnection that owns a type TProtocol object. Of course, this requires TConnection to know about TProtocol, and so I have to import the TProtocol.bmx file.
I'd also like the protocol itself to have a 'pointer' (well a TConnection object that is set to its owner) back to it's owner TConnection object so that it can transfer data back to it without invoking any functions from the TConnection itself. This requires that TProtocol knows about TConnection, though.
To summarize
TConnection owns a TProtocol object
Each TProtocol needs to know about it's owner TConnection object.
Is there any way to do this while keeping the files separate? I wish I could just "Declare" TConnection within the TProtocol file, but it doesn't seem there is a way. I tried using
extern Type TConnection
EndType
endextern
at the top of the file, just to see, but no luck. Everything else has understandably resulted in a duplicate identifier error.
I realize I can alter the design to have the TConnection object handle everything related to it's TProtocol object, but really, the TProtocol object needs to be as autonomous as possible. Given that, I'd prefer not to have to alter the design.
Hopefully there's a simple fix that I'm missing.