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
a09b973c
Commit
a09b973c
authored
Dec 21, 2012
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Smart operators for smart Ptr (feature #2637)
parent
47963f00
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
9 deletions
+11
-9
core.hpp
modules/core/include/opencv2/core/core.hpp
+3
-2
operations.hpp
modules/core/include/opencv2/core/operations.hpp
+5
-4
persistence.cpp
modules/core/src/persistence.cpp
+1
-1
matchers.cpp
modules/features2d/src/matchers.cpp
+2
-2
No files found.
modules/core/include/opencv2/core/core.hpp
View file @
a09b973c
...
...
@@ -1277,12 +1277,13 @@ public:
operator
_Tp
*
();
operator
const
_Tp
*
()
const
;
bool
operator
==
(
const
Ptr
<
_Tp
>&
ptr
)
const
;
_Tp
*
obj
;
//< the object pointer.
int
*
refcount
;
//< the associated reference counter
};
template
<
class
T
,
class
U
>
bool
operator
==
(
Ptr
<
T
>
const
&
a
,
Ptr
<
U
>
const
&
b
);
template
<
class
T
,
class
U
>
bool
operator
!=
(
Ptr
<
T
>
const
&
a
,
Ptr
<
U
>
const
&
b
);
//////////////////////// Input/Output Array Arguments /////////////////////////////////
...
...
modules/core/include/opencv2/core/operations.hpp
View file @
a09b973c
...
...
@@ -2691,10 +2691,11 @@ template<typename _Tp> template<typename _Tp2> inline const Ptr<_Tp2> Ptr<_Tp>::
return
p
;
}
template
<
typename
_Tp
>
inline
bool
Ptr
<
_Tp
>::
operator
==
(
const
Ptr
<
_Tp
>&
_ptr
)
const
{
return
refcount
==
_ptr
.
refcount
;
}
template
<
class
_Tp
,
class
_Tp2
>
inline
bool
operator
==
(
const
Ptr
<
_Tp
>&
a
,
const
Ptr
<
_Tp2
>&
b
)
{
return
a
.
refcount
==
b
.
refcount
;
}
template
<
class
_Tp
,
class
_Tp2
>
inline
bool
operator
!=
(
const
Ptr
<
_Tp
>&
a
,
const
Ptr
<
_Tp2
>&
b
)
{
return
a
.
refcount
!=
b
.
refcount
;
}
//// specializied implementations of Ptr::delete_obj() for classic OpenCV types
...
...
modules/core/src/persistence.cpp
View file @
a09b973c
...
...
@@ -5519,7 +5519,7 @@ void read( const FileNode& node, SparseMat& mat, const SparseMat& default_mat )
return
;
}
Ptr
<
CvSparseMat
>
m
=
(
CvSparseMat
*
)
cvRead
((
CvFileStorage
*
)
node
.
fs
,
(
CvFileNode
*
)
*
node
);
CV_Assert
(
CV_IS_SPARSE_MAT
(
m
));
CV_Assert
(
CV_IS_SPARSE_MAT
(
m
.
obj
));
SparseMat
(
m
).
copyTo
(
mat
);
}
...
...
modules/features2d/src/matchers.cpp
View file @
a09b973c
...
...
@@ -616,7 +616,7 @@ void FlannBasedMatcher::write( FileStorage& fs) const
{
fs
<<
"indexParams"
<<
"["
;
if
(
indexParams
!=
0
)
if
(
indexParams
)
{
std
::
vector
<
std
::
string
>
names
;
std
::
vector
<
int
>
types
;
...
...
@@ -667,7 +667,7 @@ void FlannBasedMatcher::write( FileStorage& fs) const
fs
<<
"]"
<<
"searchParams"
<<
"["
;
if
(
searchParams
!=
0
)
if
(
searchParams
)
{
std
::
vector
<
std
::
string
>
names
;
std
::
vector
<
int
>
types
;
...
...
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