src/misc/documentPointer.h

Sun, 22 Dec 2013 20:45:56 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 22 Dec 2013 20:45:56 +0200
changeset 584
12caa4e7b874
child 600
209e3f1f7b2c
permissions
-rw-r--r--

- forgot these new files out...

584
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 /*
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
2 * LDForge: LDraw parts authoring CAD
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2013 Santeri Piippo
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 *
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 * (at your option) any later version.
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9 *
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
13 * GNU General Public License for more details.
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
14 *
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
17 */
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
18
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #ifndef LDFORGE_DOCUMENT_POINTER_H
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 #define LDFORGE_DOCUMENT_POINTER_H
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22 #include "../main.h"
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24 class LDDocument;
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
25
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26 class LDDocumentPointer
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27 { PROPERTY (private, LDDocument*, Pointer, NO_OPS, STOCK_WRITE)
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
29 public:
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
30 LDDocumentPointer();
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31 LDDocumentPointer (LDDocument* ptr);
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
32 LDDocumentPointer (const LDDocumentPointer& other);
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
33 ~LDDocumentPointer();
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
34 LDDocumentPointer& operator= (LDDocument* ptr);
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
35
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
36 LDDocumentPointer& operator= (LDDocumentPointer& other)
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
37 { return operator= (other.getPointer());
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
38 }
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
39
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
40 LDDocument* operator->() const
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
41 { return getPointer();
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
42 }
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
43
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
44 operator LDDocument*() const
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
45 { return getPointer();
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
46 }
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
47
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
48 private:
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
49 void addReference();
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
50 void removeReference();
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
51 };
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
52
12caa4e7b874 - forgot these new files out...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
53 #endif // LDFORGE_DOCUMENT_POINTER_H

mercurial