On Aug 28, 2013, at 11:29 AM, tbrowd...@users.sourceforge.net wrote:
--- brlcad/trunk/include/bu.h 2013-08-28 14:24:01 UTC (rev 57223)
+++ brlcad/trunk/include/bu.h 2013-08-28 15:29:09 UTC (rev 57224)
@@ -86,6 +86,7 @@
#include <stdlib.h>
#include <sys/types.h>
+#include <time.h>
What time symbol is exposed in bu.h?
+/* FIXME: struct name should be changed to reflect more date, say, bu_attribute_data */
struct bu_attribute_value_pair {
- const char *name; /**< attribute name */
- const char *value; /**< attribute value */
+ const char *name; /**< attribute name */
+ const char *value; /**< attribute value */
+ const char *created; /**< attribute date created */
+ const char *modified; /**< attribute date modified */
+ const char *version; /**< attribute version */
+ const char *anamespace; /**< attribute anamespace */
};
Just a word of caution, this may be a significant increase in memory use on models with large numbers of objects. That's 32 additional bytes per attribute just for the pointers, 20*4 bytes per timestamp string, a half dozen attributes per object, and potentially tens of thousands of objects. (32+80) * 6 * 10000 ~= 7MB
Again, not sure it's a problem without profiling so it's fine, but just wanted to acknowledge the increase.
Note that it'll also be highly desirable to timestamp all objects (not just their attributes) ... and stash those timestamps as attributes. So this would imply we're even time-stamping our timestamps, which is of course ridiculous.
It might be worth creating a timestamp struct (not in string form). That would reduce the memory footprint overhead substantially and let them be optional (null pointer implying unset).
- * The UTC time is written into the user-provided bu_vls struct. and is
+ * The UTC time is written into the user-provided bu_vls struct and is
* also returned and guaranteed to be a non-null result, returning a
* static "NULL" UTC time if an error is encountered.
*/
Did the changes to the new date-time function look okay?
Cheers!
Sean
------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________ BRL-CAD Developer mailing list brlcad-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-devel