Usage of the custom IS classes, based on the ISInfo class, is quite straightforward - they are used exactly in the same way as the simple IS types which were explained in the previous chapter. "Listing 3.1" shows, for example, how to publish information of the type Person (see Appendix B for the Person class declaration).
The ISNamedInfo class inherits the ISInfo and therefore provides the same interface for the information declaration. But in addition to that it has a number of public methods to work with the IS repository. A program can create an instance of the custom information class based on the ISNamedInfo and use the methods of the ISNamedInfo class to insert this information into the IS, to update it or to remove from it from the IS. In another words, this class combines features provided by the ISInfo and ISInfoDictionary classes. For example, "Listing 3.2" shows how to publish information of type Person using the PersonNamed class which inherits the ISNamedInfo (see Appendix C for the PersonNamed class declaration).
The ISNamedInfo::checkin function (lines 23,36) is used here to put the new information value to the IS repository. This function updates the information value if the information already exists in the repository. Otherwise it inserts the new information to the repository. This is the main difference with the usage of the information classes, which inherit the ISInfo class.
2 July 1998 - WebMaster | Copyright © CERN 1998 |