EasyCV  0.9.36
Easy! Computer Vision
processRunSet.h
Go to the documentation of this file.
1 #pragma once
2 /****
3  *CVAC Software Disclaimer
4  *
5  *This software was developed at the Naval Postgraduate School, Monterey, CA,
6  *by employees of the Federal Government in the course of their official duties.
7  *Pursuant to title 17 Section 105 of the United States Code this software
8  *is not subject to copyright protection and is in the public domain. It is
9  *an experimental system. The Naval Postgraduate School assumes no
10  *responsibility whatsoever for its use by other parties, and makes
11  *no guarantees, expressed or implied, about its quality, reliability,
12  *or any other characteristic.
13  *We would appreciate acknowledgement and a brief notification if the software
14  *is used.
15  *
16  *Redistribution and use in source and binary forms, with or without
17  *modification, are permitted provided that the following conditions are met:
18  * * Redistributions of source code must retain the above notice,
19  * this list of conditions and the following disclaimer.
20  * * Redistributions in binary form must reproduce the above notice,
21  * this list of conditions and the following disclaimer in the
22  * documentation and/or other materials provided with the distribution.
23  * * Neither the name of the Naval Postgraduate School, nor the name of
24  * the U.S. Government, nor the names of its contributors may be used
25  * to endorse or promote products derived from this software without
26  * specific prior written permission.
27  *
28  *THIS SOFTWARE IS PROVIDED BY THE NAVAL POSTGRADUATE SCHOOL (NPS) AND CONTRIBUTORS
29  *"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
30  *THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31  *ARE DISCLAIMED. IN NO EVENT SHALL NPS OR THE U.S. BE LIABLE FOR ANY
32  *DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
33  *(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34  *LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
35  *ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36  *(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37  *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38  *****/
43 #include <util/FileUtils.h>
44 #include <util/ServiceMan.h>
45 #include <Data.h>
46 #include <Services.h>
47 #include <iostream>
48 #include <map>
49 #include <utility>
50 
51 #if defined(WIN32)
52  #include <winbase.h>
53 #endif
54 
55 namespace cvac
56 {
57 
66  typedef ResultSet (*DoDetectFunc) ( DetectorPtr detector, const char *filename);
67 
73  void processRunSet(DetectorPtr detector,
74  const DetectorCallbackHandlerPrx &client,
75  DoDetectFunc detectFunc,
76  const RunSet &run,
77  const std::string &pathPrefix,
78  ServiceManager *servMan
79  );
80 
81  void sendResultsToClient( const DetectorCallbackHandlerPrx &client,
82  const ResultSet& results );
83 
84  // Check for any chars within the string that could upset the detector
85  bool containsIllegalChars(FilePath filePath);
86 
87  // Skip detector execution on input files that match undesired substring(s)
88  //bool shouldIgnore(FilePath filePath);
89 
90 
91  void addToRunSet( RunSet& runSet, const std::string& relativePath,
92  const std::string& filename, const Purpose& purpose, LocationPtr loc = NULL); // Using Purpose
93  void addToRunSet( RunSet& runSet, const std::string& relativePath,
94  const std::string& filename, int classID, LocationPtr loc = NULL); // Using ID of Class
95 
96  // Pair the old filename and the new symlink filename in a map
97  void addFilenamePair(const std::string& filename, const std::string& symLinkName);
98 
99  std::string getSymlinkSubstitution(const std::string& illegalFileName);
100 
104  std::string getLegalPath(std::string tempDir, FilePath filePath, bool &newSymlink);
105 
111  std::string fixupRunSet( RunSet &runset, const std::string &CVAC_DataDir);
112 
116  std::string getClientConnectionName(const Ice::Current &cur);
117 
118 }
Definition: ServiceMan.h:151
void sendResultsToClient(const DetectorCallbackHandlerPrx &client, const ResultSet &results)
Definition: Data.ice:216
tuple runset
Definition: bowDemo_ROC.py:23
Definition: Data.ice:7
Definition: Data.ice:56
void addToRunSet(RunSet &runSet, const std::string &relativePath, const std::string &filename, const Purpose &purpose, LocationPtr loc=NULL)
Definition: processRunSet.cpp:317
tuple results
Definition: bowDemo_ROC.py:92
std::string fixupRunSet(RunSet &runset, const std::string &CVAC_DataDir)
Definition: processRunSet.cpp:490
std::string getSymlinkSubstitution(const std::string &illegalFileName)
Definition: processRunSet.cpp:381
Definition: Data.ice:48
bool containsIllegalChars(FilePath filePath)
Definition: processRunSet.cpp:157
ResultSet(* DoDetectFunc)(DetectorPtr detector, const char *filename)
Definition: processRunSet.h:66
std::string getLegalPath(std::string tempDir, FilePath filePath, bool &newSymlink)
Definition: processRunSet.cpp:462
std::string getClientConnectionName(const Ice::Current &cur)
Definition: processRunSet.cpp:548
tuple CVAC_DataDir
Definition: easy.py:68
void processRunSet(DetectorPtr detector, const DetectorCallbackHandlerPrx &client, DoDetectFunc detectFunc, const RunSet &run, const std::string &pathPrefix, ServiceManager *servMan)
Definition: processRunSet.cpp:171
void addFilenamePair(const std::string &filename, const std::string &symLinkName)
tuple detector
Definition: bootstrapping.py:23