summaryrefslogtreecommitdiff
path: root/docs/data/core/ptr.json
blob: 50fea1a9aa7bcb8a09ad01e0df32203573e9e2c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
	"format": 1,
	"id": "saw-ptr",
	"kind": "class",
	"name": "ptr",
	"namespace": "saw",
	"module": "core",
	"header": "modules/core/c++/common.hpp",
	"brief_description": "Non owning pointer which may be empty.",
	"detailed_description": [
		[
			"States in the type system that something is referred to but not owned. Copyable and reassignable, unlike",
			{"name": "ref", "id": "saw-ref"},
			"and checkable, unlike a reference."
		],
		[
			"Dereferencing goes through the call operator rather than through star or arrow, which keeps the indirection visible at every use."
		],
		[
			"Nothing here tracks lifetime. A ptr outliving its target is a bug the type cannot catch, which is why the classes holding one, such as the data servers, forbid moving themselves."
		]
	],
	"templates": [
		{"name": "T", "kind": "type"}
	],
	"attributes": {
		"saw-ptr-ptr_": {
			"id": "saw-ptr-ptr_",
			"name": "ptr_",
			"type": ["T *"],
			"visibility": "private"
		}
	},
	"functions": {
		"saw-ptr-ctor-1": {
			"id": "saw-ptr-ctor-1",
			"name": "ptr",
			"type": [],
			"brief_description": "Empty."
		},
		"saw-ptr-ctor-2": {
			"id": "saw-ptr-ctor-2",
			"name": "ptr",
			"type": [],
			"brief_description": "Pointing at an object. Implicit, so passing an object where a ptr is expected just works.",
			"parameters": [
				{"name": "ptr__", "type": ["T &"]}
			]
		},
		"saw-ptr-call": {
			"id": "saw-ptr-call",
			"name": "operator()",
			"type": ["T &"],
			"brief_description": "The pointed at object. Undefined if empty."
		},
		"saw-ptr-is_valid": {
			"id": "saw-ptr-is_valid",
			"name": "is_valid",
			"type": ["bool"],
			"const": true,
			"brief_description": "Whether it points at anything."
		}
	}
}