• 시그널-슬롯 매커니즘을 Standalone(컴파일한 application)에서 사용하기 위해서는 시그널과 슬롯에 관련된 정보를 TROOT 객체에 알려줄 필요가 있습니다. 제가 사용한 프로그램의 경우 TROOT 대신에 TApplication 객체에 이 정보를 넘겨주어야 하는데, ROOT CINT가 아닌 상태에서는 이를 알려줄 방법이 전혀 없습니다.
  • 따라서, rootcint라는 명령어를 이용하여 모든 관련정보를 가지고 있는 별도의 클래스를 정의해줄 필요가 있습니다.
  • Usage: rootcint -f A.cxx B.h C.h D.h ..... LinkDef?.h
  • 여기서 LinkDef?.h는 각 클래스의 header파일에서 ClassDef?(class,1)로 정의한 이름을 집어넣어야 합니다.
// LinkDef.h   사용 예제
#ifndef __CINT__
#error Not for compilation
#else

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class GenerateInterface;
#pragma link C++ class DetectInterface;
#pragma link C++ class AnalysisInterface;
#pragma link C++ class NodeButton;
#pragma link C++ class GenerateButton;
#pragma link C++ class DetectButton;
#pragma link C++ class AnalysisButton;

#endif
  • rootcint는 a.cxx와 a.h를 만들어냅니다. a.h를 include하는 실행용 소스 파일을 만들어서 사용을 하든지 저 처럼 a.cxx 밑에 소스를 추가하셔서 작업을 하시면 Make로 실행파일을 컴파일-링크를 할 수 있습니다.

  • Note : standalone은 실행속도가 빠르고, pipe, system()와 같은 시스템 명령어를 사용할 수 있습니다.

-- GunmoRyu - 06 May 2009

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2009-05-06 - GunmoRyu
 
KOREA-CMS
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding KoreaCmsWiki? Send feedback