Re: [classad-users] saving a ClassAdCollection to a file


Date: Thu, 14 Mar 2002 17:17:30 -0600 (CST)
From: Alain Aslag Roy <roy@xxxxxxxxxxx>
Subject: Re: [classad-users] saving a ClassAdCollection to a file
John Bethencourt asked:
>I'm working on figuring out how to save a ClassAdCollection to a file. It 
>seems that all the methods that do that are protected, so my code can't 
>call them. How should this be done?

Your code doesn't need to call them. Instead, after you create a 
ClassAdCollection, call:

virtual bool InitializeFromLog(const string &filename);

This will either create the file, or read the ClassAds from the file if it 
already exists. Each time you add or modify a ClassAd, it is saved to this 
file. If you frequently modify ClassAds, you may wish to call to called 
TruncateLog() periodically. This will rewrite the file so it only contains 
the current state of the collection instead of the sequence of changes that 
were made to it.

>Also, is there any documentation available for ClassAdCollection's?

Right now, there is just the source code. Hopefully sometime soon there 
will be more documentation.

-alain




[← Prev in Thread] Current Thread [Next in Thread→]