Hi guys,
I have created a set of components for managing a communications connection and its protocol. I have a structure that stores information for a connection, which I have to pass in and out of each component. This structure include buffers, which are changed continuously and have to be fast.
I would like to avoid using this method of feeding a local connection information variable on through the program, as everything will go wrong if I forget shift registers, access the connection in parallel or such. I would like to use something like the queue "references" instead. I created a class with all the comms components, which use the class datatype to store the connection information (my first class). This did not help as I still had to circulate the class through the program, unlike the queues. One option is to have a registry that stores all the connection information (as array of (connection information) ) and keep only the reference into the registry in the class datatype, but I reckon this would be rather slow, inefficient and unnecessarily complex. Alternatively I could store the connection information as a class global, but then the data is shared by all instances of the class.
Another option would be to dynamically create an instance of the connection information and store a reference to it in the class datatype. Is there a way of instantiating data dynamically and getting a reference to it?
Does anyone know how the queues are programmed or of any efficient way of doing what I want to do?
Thanks
Christie