Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Niflib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grant Kim
Niflib
Commits
cc12f4c5
Commit
cc12f4c5
authored
18 years ago
by
Shon Ferguson
Browse files
Options
Downloads
Patches
Plain Diff
Gave Type it's own files and finished implementing member functions.
parent
7fcaa845
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
niflib.vcproj
+6
-0
6 additions, 0 deletions
niflib.vcproj
obj/NiObject.cpp
+0
-24
0 additions, 24 deletions
obj/NiObject.cpp
obj/NiObject.h
+1
-16
1 addition, 16 deletions
obj/NiObject.h
obj/Type.cpp
+28
-0
28 additions, 0 deletions
obj/Type.cpp
obj/Type.h
+29
-0
29 additions, 0 deletions
obj/Type.h
with
64 additions
and
40 deletions
niflib.vcproj
+
6
−
0
View file @
cc12f4c5
...
...
@@ -794,6 +794,9 @@
<File
RelativePath=
".\obj\TriBasedGeomData.cpp"
>
</File>
<File
RelativePath=
".\obj\Type.cpp"
>
</File>
</Filter>
</Filter>
<Filter
...
...
@@ -1457,6 +1460,9 @@
<File
RelativePath=
".\obj\TriBasedGeomData.h"
>
</File>
<File
RelativePath=
".\obj\Type.h"
>
</File>
</Filter>
</Filter>
<Filter
...
...
This diff is collapsed.
Click to expand it.
obj/NiObject.cpp
+
0
−
24
View file @
cc12f4c5
...
...
@@ -9,30 +9,6 @@ const Type NiObject::TYPE("NiObject", NULL );
//Static to track total number of objects in memory. Initialize to zero.
unsigned
int
NiObject
::
objectsInMemory
=
0
;
/*
* Type Methods
*/
bool
Type
::
IsSameType
(
const
Type
&
compare_to
)
const
{
return
&
compare_to
==
this
;
}
bool
Type
::
IsDerivedType
(
const
Type
&
compare_to
)
const
{
const
Type
*
search
=
this
;
while
(
search
!=
NULL
)
{
if
(
search
==
&
compare_to
)
{
return
true
;
}
search
=
search
->
base_type
;
}
return
false
;
}
/*
* NiObject Methods
*/
bool
NiObject
::
IsSameType
(
const
Type
&
compare_to
)
const
{
return
GetType
().
IsSameType
(
compare_to
);
}
...
...
This diff is collapsed.
Click to expand it.
obj/NiObject.h
+
1
−
16
View file @
cc12f4c5
...
...
@@ -14,27 +14,12 @@ All rights reserved. Please see niflib.h for licence. */
#include
<vector>
#include
"NIF_IO.h"
#include
"Ref.h"
#include
"Type.h"
#include
"xml_extract.h"
using
namespace
std
;
/**
* Run Time Type Inforamtion Class
*/
class
Type
{
public:
Type
(
const
string
&
type_name
,
const
Type
*
base_type
);
~
Type
();
string
GetTypeName
()
const
;
bool
IsSameType
(
const
Type
&
compare_to
)
const
;
bool
IsDerivedType
(
const
Type
&
compare_to
)
const
;
bool
operator
<
(
const
Type
&
compare_to
)
const
{
return
(
this
<
&
compare_to
);
}
private
:
string
name
;
const
Type
*
base_type
;
};
/**
* NiObject - Base Object class from which all other objects derive
...
...
This diff is collapsed.
Click to expand it.
obj/Type.cpp
0 → 100644
+
28
−
0
View file @
cc12f4c5
/* Copyright (c) 2006, NIF File Format Library and Tools
All rights reserved. Please see niflib.h for licence. */
#include
"Type.h"
Type
::
Type
(
const
string
&
type_name
,
const
Type
*
par_type
)
:
name
(
type_name
),
base_type
(
par_type
)
{}
Type
::~
Type
()
{}
bool
Type
::
operator
<
(
const
Type
&
compare_to
)
const
{
return
(
this
<
&
compare_to
);
}
bool
Type
::
IsSameType
(
const
Type
&
compare_to
)
const
{
return
&
compare_to
==
this
;
}
bool
Type
::
IsDerivedType
(
const
Type
&
compare_to
)
const
{
const
Type
*
search
=
this
;
while
(
search
!=
NULL
)
{
if
(
search
==
&
compare_to
)
{
return
true
;
}
search
=
search
->
base_type
;
}
return
false
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
obj/Type.h
0 → 100644
+
29
−
0
View file @
cc12f4c5
/* Copyright (c) 2006, NIF File Format Library and Tools
All rights reserved. Please see niflib.h for licence. */
#ifndef _TYPE_H_
#define _TYPE_H_
#include
<string>
using
namespace
std
;
/**
* Run Time Type Inforamtion Class
*/
class
Type
{
public:
Type
(
const
string
&
type_name
,
const
Type
*
par_type
);
~
Type
();
string
GetTypeName
()
const
;
bool
IsSameType
(
const
Type
&
compare_to
)
const
;
bool
IsDerivedType
(
const
Type
&
compare_to
)
const
;
bool
operator
<
(
const
Type
&
compare_to
)
const
;
private:
string
name
;
const
Type
*
base_type
;
};
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment