Fawkes API  Fawkes Development Version
qa_shmimg.cpp
1 
2 /***************************************************************************
3  * qa_shmimg.h - QA for shared memory image
4  *
5  * Created: Thu Oct 18 19:45:54 2007
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 /// @cond QA
25 
26 #include <fvutils/ipc/shm_image.h>
27 
28 #include <iostream>
29 
30 using namespace std;
31 using namespace firevision;
32 
33 int
34 main(int argc, char **argv)
35 {
36  SharedMemoryImageBuffer *buf, *buf2;
37 
38  buf = new SharedMemoryImageBuffer("QA test image", YUV422_PLANAR, 100, 100);
39  buf2 = new SharedMemoryImageBuffer("QA test image 2", YUV422_PLANAR, 100, 100);
40 
41  if ( buf->is_valid() ) {
42  cout << "IS valid!" << endl;
43  } else {
44  cout << "Is NOT valid!" << endl;
45  }
46 
47  sleep(100);
48 
49  delete buf;
50  delete buf2;
51 
52  return 0;
53 }
54 
55 
56 
57 /// @endcond
STL namespace.
bool is_valid() const
Check validity of shared memory segment.
Definition: shm.cpp:766
Shared memory image buffer.
Definition: shm_image.h:181