nfd::tools::nfdc::FindFace Class Reference

procedure to find a face More...

#include <tools/nfdc/find-face.hpp>

+ Inheritance diagram for nfd::tools::nfdc::FindFace:
+ Collaboration diagram for nfd::tools::nfdc::FindFace:

Public Types

enum  Code {
  Code::OK = 0,
  Code::ERROR = 1,
  Code::NOT_FOUND = 3,
  Code::CANONIZE_ERROR = 4,
  Code::AMBIGUOUS = 5,
  Code::NOT_STARTED = -1,
  Code::IN_PROGRESS = -2
}
 
enum  DisambiguationStyle { DisambiguationStyle::LOCAL_URI = 1 }
 

Public Member Functions

 FindFace (ExecuteContext &ctx)
 
Code execute (const FaceUri &faceUri, bool allowMulti=false)
 find face by FaceUri More...
 
Code execute (uint64_t faceId)
 find face by FaceId More...
 
Code execute (const boost::any &faceIdOrUri, bool allowMulti=false)
 find face by FaceId or FaceUri More...
 
Code execute (const FaceQueryFilter &filter, bool allowMulti=false)
 find face by FaceQueryFilter More...
 
const std::string & getErrorReason () const
 
uint64_t getFaceId () const
 
std::set< uint64_t > getFaceIds () const
 
const FaceStatus & getFaceStatus () const
 
const std::vector< FaceStatus > & getResults () const
 
void printDisambiguation (std::ostream &os, DisambiguationStyle style) const
 print results for disambiguation More...
 

Detailed Description

procedure to find a face

Definition at line 40 of file find-face.hpp.

Member Enumeration Documentation

Enumerator
OK 

found exactly one face, or found multiple faces when allowMulti is true

ERROR 

unspecified error

NOT_FOUND 

found zero face

CANONIZE_ERROR 

error during FaceUri canonization

AMBIGUOUS 

found multiple faces and allowMulti is false

NOT_STARTED 

for internal use

IN_PROGRESS 

for internal use

Definition at line 43 of file find-face.hpp.

Enumerator
LOCAL_URI 

print FaceId and LocalUri

Definition at line 53 of file find-face.hpp.

Constructor & Destructor Documentation

nfd::tools::nfdc::FindFace::FindFace ( ExecuteContext ctx)
explicit

Definition at line 36 of file find-face.cpp.

Member Function Documentation

FindFace::Code nfd::tools::nfdc::FindFace::execute ( const FaceUri &  faceUri,
bool  allowMulti = false 
)

find face by FaceUri

Precondition
execute has not been invoked

Definition at line 42 of file find-face.cpp.

FindFace::Code nfd::tools::nfdc::FindFace::execute ( uint64_t  faceId)

find face by FaceId

Precondition
execute has not been invoked

Definition at line 50 of file find-face.cpp.

FindFace::Code nfd::tools::nfdc::FindFace::execute ( const boost::any &  faceIdOrUri,
bool  allowMulti = false 
)

find face by FaceId or FaceUri

Parameters
faceIdOrUria boost::any that contains uint64_t or FaceUri
allowMultieffective only if faceIdOrUri contains a FaceUri
Exceptions
boost::bad_any_castfaceIdOrUri is neither uint64_t nor FaceUri

Definition at line 58 of file find-face.cpp.

FindFace::Code nfd::tools::nfdc::FindFace::execute ( const FaceQueryFilter &  filter,
bool  allowMulti = false 
)

find face by FaceQueryFilter

Precondition
execute has not been invoked

Definition at line 70 of file find-face.cpp.

const std::string& nfd::tools::nfdc::FindFace::getErrorReason ( ) const
inline

Definition at line 113 of file find-face.hpp.

uint64_t nfd::tools::nfdc::FindFace::getFaceId ( ) const
inline

Definition at line 107 of file find-face.hpp.

std::set< uint64_t > nfd::tools::nfdc::FindFace::getFaceIds ( ) const
Returns
FaceId for all results

Definition at line 152 of file find-face.cpp.

const FaceStatus & nfd::tools::nfdc::FindFace::getFaceStatus ( ) const
Returns
a single face status
Precondition
getResults().size() == 1

Definition at line 162 of file find-face.cpp.

const std::vector<FaceStatus>& nfd::tools::nfdc::FindFace::getResults ( ) const
inline
Returns
face status for all results

Definition at line 90 of file find-face.hpp.

void nfd::tools::nfdc::FindFace::printDisambiguation ( std::ostream &  os,
DisambiguationStyle  style 
) const

print results for disambiguation

Definition at line 169 of file find-face.cpp.