HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OP_Stat.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OP_Stat.h ( OP Library, C++)
7  *
8  * COMMENTS: Stats for an OP.
9  * Creation Time is the time the OP was first created
10  * The following operations on an OP_Node should touch the modify time:
11  * Parameter change/animated
12  * Spare channel modified
13  * Node renamed
14  * Child created/destroyed
15  * Input changed
16  * Locked contents changed (i.e. modelled)
17  * The operator is "touched"
18  * The cook time is modified whenever the OP is cooked
19  */
20 
21 #ifndef __OP_Stat__
22 #define __OP_Stat__
23 
24 #include "OP_API.h"
25 #include <sys/types.h>
26 #include <SYS/SYS_Types.h>
27 #include <iosfwd>
28 class UT_IStream;
29 
30 class OP_API OP_Stat {
31 public:
32  OP_Stat();
33  ~OP_Stat();
34 
35  bool load(UT_IStream &is, unsigned *permission);
36  int save(std::ostream &os, unsigned permission=0777);
37 
38  void touch(); // Change modify time
39 
40  time_t getCreateTime() const { return myCreateTime; }
41  time_t getModifyTime() const { return myModifyTime; }
42  int getAuthorId() const { return myAuthor; }
43  const char *getAuthor() const;
44 
45  void setAuthor(const char *name);
46 
47  int64 getMemoryUsage(bool inclusive) const
48  { return inclusive ? sizeof(*this) : 0; }
49 
50 private:
51  time_t myCreateTime;
52  time_t myModifyTime;
53  int myAuthor;
54 };
55 
56 #endif
time_t getCreateTime() const
Definition: OP_Stat.h:40
time_t getModifyTime() const
Definition: OP_Stat.h:41
long long int64
Definition: SYS_Types.h:106
GLuint const GLchar * name
Definition: glcorearb.h:785
int64 getMemoryUsage(bool inclusive) const
Definition: OP_Stat.h:47
#define OP_API
Definition: OP_API.h:10
int getAuthorId() const
Definition: OP_Stat.h:42