J
Joe
I'm quite new to object oriented programming, so this is probably a really
basic problem that there is an obvious solution to, but anyway...
I am looking for a little advice on a good way of storing a list of channels
for a video capture application. I have a channel class that contains
information such as the tuning frequency and the channel name. I then want
to have a channel list class which is used to store the channels and their
associated channel numbers (as defined by the user).
The ChannelList class will provide functionality such as:
bool RetrieveChannel (int ChanNumber, channel &Chan) - Finds the channel
specified by the number or returns false if there is no channel in that
position.
bool AddChannel (int ChanNumber, channel Chan) - Adds the given channel
in the specified position or returns false if there is already one there
bool MoveChannel (int OldChanNumber, int NewChannelNumber) - Moves the
channel from one position to another.
I also need some way of listing all the channels and this is where I start
to get stuck. How do I actually "store" each channel object in the
ChannelList? How should I associate the channel number with each channel
object? I suppose I could add a channel number entry to the channel class,
but this doesn't seem quite right to me (in terms of keeping a strict class
heirarchy) or am I wrong?
Any help is appreciated.
TIA,
Joe.
basic problem that there is an obvious solution to, but anyway...
I am looking for a little advice on a good way of storing a list of channels
for a video capture application. I have a channel class that contains
information such as the tuning frequency and the channel name. I then want
to have a channel list class which is used to store the channels and their
associated channel numbers (as defined by the user).
The ChannelList class will provide functionality such as:
bool RetrieveChannel (int ChanNumber, channel &Chan) - Finds the channel
specified by the number or returns false if there is no channel in that
position.
bool AddChannel (int ChanNumber, channel Chan) - Adds the given channel
in the specified position or returns false if there is already one there
bool MoveChannel (int OldChanNumber, int NewChannelNumber) - Moves the
channel from one position to another.
I also need some way of listing all the channels and this is where I start
to get stuck. How do I actually "store" each channel object in the
ChannelList? How should I associate the channel number with each channel
object? I suppose I could add a channel number entry to the channel class,
but this doesn't seem quite right to me (in terms of keeping a strict class
heirarchy) or am I wrong?
Any help is appreciated.
TIA,
Joe.