HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 
29 class UT_IStream;
30 class UT_StringHolder;
31 class UT_StringRef;
32 
33 class OP_API OP_Stat {
34 public:
35  OP_Stat();
36  ~OP_Stat();
37 
38  bool load(UT_IStream &is, unsigned *permission);
39  bool save(std::ostream &os, unsigned permission=0777);
40 
41  void touch(); // Change modify time
42 
43  time_t getCreateTime() const { return myCreateTime; }
44  time_t getModifyTime() const { return myModifyTime; }
45 
46  bool isAuthorCurrentUser() const { return (myAuthor == 0); }
47 
48  const UT_StringHolder
49  &getAuthor() const;
50 
51  void setAuthor(const UT_StringRef &name);
52 
53  int64 getMemoryUsage(bool inclusive) const
54  { return inclusive ? sizeof(*this) : 0; }
55 
56 private:
57  time_t myCreateTime;
58  time_t myModifyTime;
59  int myAuthor;
60 };
61 
62 #endif
time_t getCreateTime() const
Definition: OP_Stat.h:43
time_t getModifyTime() const
Definition: OP_Stat.h:44
long long int64
Definition: SYS_Types.h:107
GLuint const GLchar * name
Definition: glcorearb.h:785
int64 getMemoryUsage(bool inclusive) const
Definition: OP_Stat.h:53
#define OP_API
Definition: OP_API.h:10
bool isAuthorCurrentUser() const
Definition: OP_Stat.h:46