Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
4c19e027
Commit
4c19e027
authored
Oct 02, 2013
by
Roman Donchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cherry-picked mariusmuja/flann@b615f2694723fe402b8bbe50d77e622beff7f171.
Original author: Alex Wilson.
parent
78c4ffec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
any.h
modules/flann/include/opencv2/flann/any.h
+4
-2
No files found.
modules/flann/include/opencv2/flann/any.h
View file @
4c19e027
...
@@ -44,6 +44,7 @@ struct base_any_policy
...
@@ -44,6 +44,7 @@ struct base_any_policy
virtual
void
clone
(
void
*
const
*
src
,
void
**
dest
)
=
0
;
virtual
void
clone
(
void
*
const
*
src
,
void
**
dest
)
=
0
;
virtual
void
move
(
void
*
const
*
src
,
void
**
dest
)
=
0
;
virtual
void
move
(
void
*
const
*
src
,
void
**
dest
)
=
0
;
virtual
void
*
get_value
(
void
**
src
)
=
0
;
virtual
void
*
get_value
(
void
**
src
)
=
0
;
virtual
void
*
get_value
(
void
*
const
*
src
)
=
0
;
virtual
::
size_t
get_size
()
=
0
;
virtual
::
size_t
get_size
()
=
0
;
virtual
const
std
::
type_info
&
type
()
=
0
;
virtual
const
std
::
type_info
&
type
()
=
0
;
virtual
void
print
(
std
::
ostream
&
out
,
void
*
const
*
src
)
=
0
;
virtual
void
print
(
std
::
ostream
&
out
,
void
*
const
*
src
)
=
0
;
...
@@ -69,6 +70,7 @@ struct small_any_policy : typed_base_any_policy<T>
...
@@ -69,6 +70,7 @@ struct small_any_policy : typed_base_any_policy<T>
virtual
void
clone
(
void
*
const
*
src
,
void
**
dest
)
{
*
dest
=
*
src
;
}
virtual
void
clone
(
void
*
const
*
src
,
void
**
dest
)
{
*
dest
=
*
src
;
}
virtual
void
move
(
void
*
const
*
src
,
void
**
dest
)
{
*
dest
=
*
src
;
}
virtual
void
move
(
void
*
const
*
src
,
void
**
dest
)
{
*
dest
=
*
src
;
}
virtual
void
*
get_value
(
void
**
src
)
{
return
reinterpret_cast
<
void
*>
(
src
);
}
virtual
void
*
get_value
(
void
**
src
)
{
return
reinterpret_cast
<
void
*>
(
src
);
}
virtual
void
*
get_value
(
void
*
const
*
src
)
{
return
const_cast
<
void
*>
(
reinterpret_cast
<
const
void
*>
(
src
)
);
}
virtual
void
print
(
std
::
ostream
&
out
,
void
*
const
*
src
)
{
out
<<
*
reinterpret_cast
<
T
const
*>
(
src
);
}
virtual
void
print
(
std
::
ostream
&
out
,
void
*
const
*
src
)
{
out
<<
*
reinterpret_cast
<
T
const
*>
(
src
);
}
};
};
...
@@ -93,6 +95,7 @@ struct big_any_policy : typed_base_any_policy<T>
...
@@ -93,6 +95,7 @@ struct big_any_policy : typed_base_any_policy<T>
**
reinterpret_cast
<
T
**>
(
dest
)
=
**
reinterpret_cast
<
T
*
const
*>
(
src
);
**
reinterpret_cast
<
T
**>
(
dest
)
=
**
reinterpret_cast
<
T
*
const
*>
(
src
);
}
}
virtual
void
*
get_value
(
void
**
src
)
{
return
*
src
;
}
virtual
void
*
get_value
(
void
**
src
)
{
return
*
src
;
}
virtual
void
*
get_value
(
void
*
const
*
src
)
{
return
const_cast
<
void
*>
(
*
src
);
}
virtual
void
print
(
std
::
ostream
&
out
,
void
*
const
*
src
)
{
out
<<
*
reinterpret_cast
<
T
const
*>
(
*
src
);
}
virtual
void
print
(
std
::
ostream
&
out
,
void
*
const
*
src
)
{
out
<<
*
reinterpret_cast
<
T
const
*>
(
*
src
);
}
};
};
...
@@ -257,8 +260,7 @@ public:
...
@@ -257,8 +260,7 @@ public:
const
T
&
cast
()
const
const
T
&
cast
()
const
{
{
if
(
policy
->
type
()
!=
typeid
(
T
))
throw
anyimpl
::
bad_any_cast
();
if
(
policy
->
type
()
!=
typeid
(
T
))
throw
anyimpl
::
bad_any_cast
();
void
*
obj
=
const_cast
<
void
*>
(
object
);
T
*
r
=
reinterpret_cast
<
T
*>
(
policy
->
get_value
(
&
object
));
T
*
r
=
reinterpret_cast
<
T
*>
(
policy
->
get_value
(
&
obj
));
return
*
r
;
return
*
r
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment