test-CfgProxy.cxx File Reference

#include "Midad/Util/NamedFactory.h"
#include "Midad/Base/CfgProxy.h"
#include "Configurable/CfgConfigurable.h"
#include <iostream>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])

Variables

CfgProxy gs_cf11 ("name1","CfgGroup1",(CfgConfigurable *) 11)
CfgProxy gs_cf12 ("name1","CfgGroup2",(CfgConfigurable *) 12)
CfgProxy gs_cf21 ("name2","CfgGroup1",(CfgConfigurable *) 21)
CfgProxy gs_cf22 ("name2","CfgGroup2",(CfgConfigurable *) 22)

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 14 of file test-CfgProxy.cxx.

References CfgProxy::GetCfg(), NamedFactory::GetProxy(), and NamedFactory::Instance().

00015 {
00016     NamedFactory& cfg1 = NamedFactory::Instance("CfgGroup1");
00017     NamedFactory& cfg2 = NamedFactory::Instance("CfgGroup2");
00018 
00019     CfgProxy *cp11 = dynamic_cast<CfgProxy*>(cfg1.GetProxy("name1"));
00020     CfgProxy *cp21 = dynamic_cast<CfgProxy*>(cfg1.GetProxy("name2"));
00021     CfgProxy *cp12 = dynamic_cast<CfgProxy*>(cfg2.GetProxy("name1"));
00022     CfgProxy *cp22 = dynamic_cast<CfgProxy*>(cfg2.GetProxy("name2"));
00023 
00024     assert (cp11);
00025     assert (cp12);
00026     assert (cp21);
00027     assert (cp22);
00028 
00029 
00030     cerr << (int)(cp11->GetCfg()) 
00031          << " "
00032          << (int)(cp21->GetCfg()) 
00033          << endl
00034          << (int)(cp12->GetCfg()) 
00035          << " "
00036          << (int)(cp22->GetCfg()) 
00037          << endl;
00038 
00039     return 0;
00040 } // end of main()


Variable Documentation

CfgProxy gs_cf11("name1","CfgGroup1",(CfgConfigurable *) 11)
CfgProxy gs_cf12("name1","CfgGroup2",(CfgConfigurable *) 12)
CfgProxy gs_cf21("name2","CfgGroup1",(CfgConfigurable *) 21)
CfgProxy gs_cf22("name2","CfgGroup2",(CfgConfigurable *) 22)

Generated on 8 Jul 2019 for loon by  doxygen 1.6.1