I´m learning to write a Management of digital media with CORBA. I don´t know how to implement the Method VMSgetMediaAvailable () raises (ServerException).
struct VMSMedia {
long ObjectId;
long ProviderId;
Genre Type;
string Title;
string ProductionCountry;
short ProductionYear;
short Length;
StatusType Status;
};
struct VMSProvider {
long ObjectId;
string Name;
string FirstName;
long ZIPCode; /* short does not work */
string Address;
};
interface VMSRepository {
readonly attribute long currentMaxProviderId;
readonly attribute long currentMaxMediaId;
oneway void save ();
oneway void addProvider (in VMSProvider p);
oneway void delProvider (in long id);
VMSProvider getProvider (in long id)
raises (ServerException);
VMSProviderSeq getProviders ()
raises (ServerException);
oneway void addMedia (in VMSMedia p);
oneway void delMedia (in long id);
VMSMedia getMedia (in long id)
raises (ServerException);
VMSMediaSeq getMediaOfType (in Genre type)
raises (ServerException);
VMSMediaSeq getMediaYoungerThan (in short year)
raises (ServerException);
//here new Method
VMSMediaSeq getMediaAvailable () raises
(ServerException);
};
};
<>
I know I have to create a new Stub and a new Skelton in that IDL file and I have to implement this method. I need to ask if there is Media available, so i have to do a if- Statement right? But I don´t know how I can do it.
I also have a class with the Name of Repository_i.cc where i have to write the method or implement this method. all I have is this: