Skip to content

Commit 4c3e27b

Browse files
committed
fix(Visual): inline Factory symbols
1 parent 0a37868 commit 4c3e27b

File tree

6 files changed

+71
-28
lines changed

6 files changed

+71
-28
lines changed

include/geode/basic/factory.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ namespace geode
6666

6767
public:
6868
template < typename DerivedClass >
69-
static void register_creator( Key key )
69+
static inline void register_creator( Key key )
7070
{
7171
static_assert( std::is_base_of< BaseClass, DerivedClass >::value,
7272
"DerivedClass is not a subclass of BaseClass" );
@@ -84,7 +84,7 @@ namespace geode
8484
}
8585
}
8686

87-
static std::unique_ptr< BaseClass > create(
87+
static inline std::unique_ptr< BaseClass > create(
8888
const Key &key, Args... args )
8989
{
9090
const auto &store = get_store();
@@ -95,7 +95,7 @@ namespace geode
9595
return creator->second( std::forward< Args >( args )... );
9696
}
9797

98-
static absl::FixedArray< Key > list_creators()
98+
static inline absl::FixedArray< Key > list_creators()
9999
{
100100
const auto &store = get_store();
101101
absl::FixedArray< Key > creators( store.size() );
@@ -107,7 +107,7 @@ namespace geode
107107
return creators;
108108
}
109109

110-
static bool has_creator( const Key &key )
110+
static inline bool has_creator( const Key &key )
111111
{
112112
const auto &store = get_store();
113113
return store.find( key ) != store.end();
@@ -119,13 +119,14 @@ namespace geode
119119

120120
private:
121121
template < typename DerivedClass >
122-
static std::unique_ptr< BaseClass > create_function_impl( Args... args )
122+
static inline std::unique_ptr< BaseClass > create_function_impl(
123+
Args... args )
123124
{
124125
return std::unique_ptr< BaseClass >{ new DerivedClass{
125126
std::forward< Args >( args )... } };
126127
}
127128

128-
static FactoryStore &get_store()
129+
static inline FactoryStore &get_store()
129130
{
130131
return Singleton::instance< Factory >().store_;
131132
}

include/geode/mesh/builder/mesh_builder_factory.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ namespace geode
3939
MeshBuilderFactoryKey() {}
4040
};
4141

42-
class opengeode_mesh_api MeshBuilderFactory : public Factory< MeshImpl,
43-
VertexSetBuilder,
44-
VertexSet&,
45-
MeshBuilderFactoryKey >
42+
class MeshBuilderFactory : public Factory< MeshImpl,
43+
VertexSetBuilder,
44+
VertexSet&,
45+
MeshBuilderFactoryKey >
4646
{
4747
public:
4848
template < typename MeshBuilder >

include/geode/model/mixin/core/vertex_identifier.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,12 @@ namespace geode
2020
*/
2121
struct opengeode_model_api ComponentMeshVertex
2222
{
23-
ComponentMeshVertex( ComponentID component_id_in, index_t vertex_id_in )
24-
: component_id( std::move( component_id_in ) ),
25-
vertex( vertex_id_in )
26-
{
27-
}
23+
ComponentMeshVertex(
24+
ComponentID component_id_in, index_t vertex_id_in );
2825

29-
bool operator==( const ComponentMeshVertex& other ) const
30-
{
31-
return component_id == other.component_id && vertex == other.vertex;
32-
}
26+
~ComponentMeshVertex();
27+
28+
bool operator==( const ComponentMeshVertex& other ) const;
3329

3430
template < typename Archive >
3531
void serialize( Archive& archive );
@@ -39,10 +35,7 @@ namespace geode
3935

4036
private:
4137
friend class bitsery::Access;
42-
ComponentMeshVertex()
43-
: component_id( bitsery::Access::create< ComponentID >() )
44-
{
45-
}
38+
ComponentMeshVertex();
4639
};
4740

4841
/*!

include/geode/model/representation/core/brep.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ namespace geode
7373
{
7474
public:
7575
BoundaryCornerRange( const BRep& brep, const Line3D& line );
76+
~BoundaryCornerRange();
7677

7778
const Corner3D& operator*() const;
7879

@@ -86,6 +87,7 @@ namespace geode
8687
{
8788
public:
8889
BoundaryLineRange( const BRep& brep, const Surface3D& surface );
90+
~BoundaryLineRange();
8991

9092
const Line3D& operator*() const;
9193

@@ -99,6 +101,7 @@ namespace geode
99101
{
100102
public:
101103
BoundarySurfaceRange( const BRep& brep, const Block3D& block );
104+
~BoundarySurfaceRange();
102105

103106
const Surface3D& operator*() const;
104107

@@ -112,6 +115,7 @@ namespace geode
112115
{
113116
public:
114117
IncidentLineRange( const BRep& brep, const Corner3D& corner );
118+
~IncidentLineRange();
115119

116120
const Line3D& operator*() const;
117121

@@ -125,6 +129,7 @@ namespace geode
125129
{
126130
public:
127131
IncidentSurfaceRange( const BRep& brep, const Line3D& line );
132+
~IncidentSurfaceRange();
128133

129134
const Surface3D& operator*() const;
130135

@@ -138,6 +143,7 @@ namespace geode
138143
{
139144
public:
140145
IncidentBlockRange( const BRep& brep, const Surface3D& surface );
146+
~IncidentBlockRange();
141147

142148
const Block3D& operator*() const;
143149

@@ -151,8 +157,8 @@ namespace geode
151157
{
152158
public:
153159
InternalCornerRange( const BRep& brep, const Surface3D& surface );
154-
155160
InternalCornerRange( const BRep& brep, const Block3D& block );
161+
~InternalCornerRange();
156162

157163
void operator++();
158164

@@ -168,8 +174,8 @@ namespace geode
168174
{
169175
public:
170176
InternalLineRange( const BRep& brep, const Surface3D& surface );
171-
172177
InternalLineRange( const BRep& brep, const Block3D& block );
178+
~InternalLineRange();
173179

174180
void operator++();
175181

@@ -185,6 +191,7 @@ namespace geode
185191
{
186192
public:
187193
InternalSurfaceRange( const BRep& brep, const Block3D& block );
194+
~InternalSurfaceRange();
188195

189196
void operator++();
190197

@@ -200,8 +207,8 @@ namespace geode
200207
{
201208
public:
202209
EmbeddingSurfaceRange( const BRep& brep, const Corner3D& corner );
203-
204210
EmbeddingSurfaceRange( const BRep& brep, const Line3D& line );
211+
~EmbeddingSurfaceRange();
205212

206213
void operator++();
207214

@@ -217,10 +224,9 @@ namespace geode
217224
{
218225
public:
219226
EmbeddingBlockRange( const BRep& brep, const Corner3D& corner );
220-
221227
EmbeddingBlockRange( const BRep& brep, const Line3D& line );
222-
223228
EmbeddingBlockRange( const BRep& brep, const Surface3D& surface );
229+
~EmbeddingBlockRange();
224230

225231
void operator++();
226232

@@ -237,6 +243,7 @@ namespace geode
237243
public:
238244
ItemSurfaceRange(
239245
const BRep& brep, const ModelBoundary3D& boundary );
246+
~ItemSurfaceRange();
240247

241248
const Surface3D& operator*() const;
242249

src/geode/model/mixin/core/vertex_identifier.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@
2727

2828
namespace geode
2929
{
30+
ComponentMeshVertex::ComponentMeshVertex(
31+
ComponentID component_id_in, index_t vertex_id_in )
32+
: component_id( std::move( component_id_in ) ), vertex( vertex_id_in )
33+
{
34+
}
35+
36+
ComponentMeshVertex::ComponentMeshVertex()
37+
: component_id( bitsery::Access::create< ComponentID >() )
38+
{
39+
}
40+
41+
ComponentMeshVertex::~ComponentMeshVertex() {} // NOLINT
42+
43+
bool ComponentMeshVertex::operator==(
44+
const ComponentMeshVertex& other ) const
45+
{
46+
return component_id == other.component_id && vertex == other.vertex;
47+
}
3048

3149
template < typename Archive >
3250
void ComponentMeshVertex::serialize( Archive& archive )

src/geode/model/representation/core/brep.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ namespace geode
9393
{
9494
}
9595

96+
BRep::BoundaryCornerRange::~BoundaryCornerRange() {} // NOLINT
97+
9698
const Corner3D& BRep::BoundaryCornerRange::operator*() const
9799
{
98100
return brep_.corner(
@@ -112,6 +114,8 @@ namespace geode
112114
{
113115
}
114116

117+
BRep::BoundaryLineRange::~BoundaryLineRange() {} // NOLINT
118+
115119
const Line3D& BRep::BoundaryLineRange::operator*() const
116120
{
117121
return brep_.line(
@@ -131,6 +135,8 @@ namespace geode
131135
{
132136
}
133137

138+
BRep::BoundarySurfaceRange::~BoundarySurfaceRange() {} // NOLINT
139+
134140
const Surface3D& BRep::BoundarySurfaceRange::operator*() const
135141
{
136142
return brep_.surface(
@@ -150,6 +156,8 @@ namespace geode
150156
{
151157
}
152158

159+
BRep::IncidentLineRange::~IncidentLineRange() {} // NOLINT
160+
153161
const Line3D& BRep::IncidentLineRange::operator*() const
154162
{
155163
return brep_.line(
@@ -169,6 +177,8 @@ namespace geode
169177
{
170178
}
171179

180+
BRep::IncidentSurfaceRange::~IncidentSurfaceRange() {} // NOLINT
181+
172182
const Surface3D& BRep::IncidentSurfaceRange::operator*() const
173183
{
174184
return brep_.surface(
@@ -188,6 +198,8 @@ namespace geode
188198
{
189199
}
190200

201+
BRep::IncidentBlockRange::~IncidentBlockRange() {} // NOLINT
202+
191203
const Block3D& BRep::IncidentBlockRange::operator*() const
192204
{
193205
return brep_.block(
@@ -214,6 +226,8 @@ namespace geode
214226
return { *this, block };
215227
}
216228

229+
BRep::InternalLineRange::~InternalLineRange() {} // NOLINT
230+
217231
BRep::InternalLineRange::InternalLineRange(
218232
const BRep& brep, const Block3D& block )
219233
: Relationships::InternalRangeIterator( brep, block.id() ),
@@ -250,6 +264,8 @@ namespace geode
250264
next_filtered_internal_iterator< Corner3D >( *this );
251265
}
252266

267+
BRep::InternalCornerRange::~InternalCornerRange() {} // NOLINT
268+
253269
BRep::InternalCornerRange BRep::internal_corners(
254270
const Block3D& block ) const
255271
{
@@ -292,6 +308,8 @@ namespace geode
292308
next_filtered_internal_iterator< Surface3D >( *this );
293309
}
294310

311+
BRep::InternalSurfaceRange::~InternalSurfaceRange() {} // NOLINT
312+
295313
void BRep::InternalSurfaceRange::operator++()
296314
{
297315
Relationships::InternalRangeIterator::operator++();
@@ -319,6 +337,8 @@ namespace geode
319337
next_filtered_embedding_iterator< Surface3D >( *this );
320338
}
321339

340+
BRep::EmbeddingSurfaceRange::~EmbeddingSurfaceRange() {} // NOLINT
341+
322342
BRep::EmbeddingSurfaceRange BRep::embedding_surfaces(
323343
const Line3D& line ) const
324344
{
@@ -375,6 +395,8 @@ namespace geode
375395
next_filtered_embedding_iterator< Block3D >( *this );
376396
}
377397

398+
BRep::EmbeddingBlockRange::~EmbeddingBlockRange() {} // NOLINT
399+
378400
BRep::EmbeddingBlockRange BRep::embedding_blocks(
379401
const Surface3D& surface ) const
380402
{
@@ -410,6 +432,8 @@ namespace geode
410432
{
411433
}
412434

435+
BRep::ItemSurfaceRange::~ItemSurfaceRange() {} // NOLINT
436+
413437
const Surface3D& BRep::ItemSurfaceRange::operator*() const
414438
{
415439
return brep_.surface(

0 commit comments

Comments
 (0)