本文整理汇总了C++中Initialise函数的典型用法代码示例。如果您正苦于以下问题:C++ Initialise函数的具体用法?C++ Initialise怎么用?C++ Initialise使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Initialise函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialise
CMOOSDBHTTPServer::CMOOSDBHTTPServer(long lDBPort, long lWebServerPort)
{
Initialise(lDBPort, lWebServerPort);
}
示例2: Initialise
BoundedArray<T>::BoundedArray(unsigned int _numElements)
{
Initialise( _numElements );
}
示例3: Initialise
CSystemTray::CSystemTray()
{
Initialise();
}
示例5: MoveHeroTo
void MoveHeroTo(int row, int column) // Ћогика движени¤ геро¤
{
unsigned char destinationCell = levelData[row][column];
bool canMoveToCell = false; // √ерой не может пройти в ¤чейку
switch (destinationCell)
{
// —вободна¤ ¤чейка
case ' ':
{
canMoveToCell = true; // √ерой может пройти в ¤чейку
break;
}
// ячейка-выход с ключом
case symbolExitKey:
{
if (isKey)
{
// ѕереход на следующий уровень
++level;
if (level < levelCount)
Initialise();
else
isGameActive = false;
}
isKey = false;
break;
}
// ячейка-выход с расставленными ¤щиками
case symbolBoxExit:
{
if (filledBoxArea == boxAreaCount)
{
// ѕереход на следующий уровень
++level;
if (level < 15)
Initialise();
else
isGameActive = false;
}
break;
}
// ячейка-выход
case symbolExit:
{
if (collectedCrystals == crystalsCount)
{
// ѕереход на следующий уровень
++level;
if (level < levelCount)
Initialise();
else
isGameActive = false;
}
break;
}
// ячейка-мина
case symbolMine:
{
Initialise();
break;
}
// ячейка-кристалл
case symbolCrystal:
{
canMoveToCell = true;
collectedCrystals++;
break;
}
// ячейка-ключ
case symbolKey:
{
canMoveToCell = true;
isKey = true;
break;
}
// ячейка места дл¤ ¤щика
case symbolBoxArea:
{
canMoveToCell = true;
break;
}
// ячейка-¤щик
case symbolBox:
{
// –асчЄт направлени¤ движени¤ геро¤:
int heroDirectionR = row - heroRow;
int heroDirectionC = column - heroColumn;
//.........这里部分代码省略.........
示例6: DEBUGFDEVICE
void MathPluginManagement::ProcessSwitchProperties(Telescope* pTelescope, const char *name, ISState *states, char *names[], int n)
{
DEBUGFDEVICE(pTelescope->getDeviceName(), INDI::Logger::DBG_DEBUG, "ProcessSwitchProperties - name(%s)", name);
if (strcmp(name, AlignmentSubsystemMathPluginsV.name) == 0)
{
int CurrentPlugin = IUFindOnSwitchIndex(&AlignmentSubsystemMathPluginsV);
IUUpdateSwitch(&AlignmentSubsystemMathPluginsV, states, names, n);
AlignmentSubsystemMathPluginsV.s = IPS_OK; // Assume OK for the time being
int NewPlugin = IUFindOnSwitchIndex(&AlignmentSubsystemMathPluginsV);
if (NewPlugin != CurrentPlugin)
{
// New plugin requested
// Unload old plugin if required
if (0 != CurrentPlugin)
{
typedef void Destroy_t(MathPlugin *);
Destroy_t* Destroy = (Destroy_t*)dlsym(LoadedMathPluginHandle, "Destroy");
if (NULL != Destroy)
{
Destroy(pLoadedMathPlugin);
pLoadedMathPlugin = NULL;
if (0 == dlclose(LoadedMathPluginHandle))
{
LoadedMathPluginHandle = NULL;
}
else
{
IDLog("MathPluginManagement - dlclose failed on loaded plugin - %s\n", dlerror());
AlignmentSubsystemMathPluginsV.s = IPS_ALERT;
}
}
else
{
IDLog("MathPluginManagement - cannot get Destroy function - %s\n", dlerror());
AlignmentSubsystemMathPluginsV.s = IPS_ALERT;
}
}
// Load the requested plugin if required
if (0 != NewPlugin)
{
std::string PluginPath(MathPluginFiles[NewPlugin - 1]);
if (NULL != (LoadedMathPluginHandle = dlopen(PluginPath.c_str(), RTLD_NOW)))
{
typedef MathPlugin* Create_t();
Create_t* Create = (Create_t*)dlsym(LoadedMathPluginHandle, "Create");
if (NULL != Create)
{
pLoadedMathPlugin = Create();
IUSaveText(&AlignmentSubsystemCurrentMathPlugin, PluginPath.c_str());
}
else
{
IDLog("MathPluginManagement - cannot get Create function - %s\n", dlerror());
AlignmentSubsystemMathPluginsV.s = IPS_ALERT;
}
}
else
{
IDLog("MathPluginManagement - cannot load plugin %s error %s\n", PluginPath.c_str(), dlerror());
AlignmentSubsystemMathPluginsV.s = IPS_ALERT;
}
}
else
{
// It is in built plugin just set up the pointers
pLoadedMathPlugin = &BuiltInPlugin;
}
}
// Update client
IDSetSwitch(&AlignmentSubsystemMathPluginsV, NULL);
}
else if (strcmp(name, AlignmentSubsystemMathPluginInitialiseV.name) == 0)
{
AlignmentSubsystemMathPluginInitialiseV.s = IPS_OK;
IUResetSwitch(&AlignmentSubsystemMathPluginInitialiseV);
// Update client display
IDSetSwitch(&AlignmentSubsystemMathPluginInitialiseV, NULL);
// Initialise or reinitialise the current math plugin
Initialise(CurrentInMemoryDatabase);
}
else if (strcmp(name, AlignmentSubsystemActiveV.name) == 0)
{
AlignmentSubsystemActiveV.s=IPS_OK;
if (0 == IUUpdateSwitch(&AlignmentSubsystemActiveV, states, names, n))
// Update client
IDSetSwitch(&AlignmentSubsystemActiveV, NULL);
}
}
示例7: Initialise
DataIndices::DataIndices( const unsigned& x, const unsigned& y, const unsigned& z ) {
Initialise( x, y, z );
}
示例8: Initialise
CSensorDataFilter::CSensorDataFilter()
{
Initialise();
}
示例9: Initialise
CColourPopup::CColourPopup()
{
Initialise();
}
示例10: main
int main(int argc, char *argv[])
{
char *datafn, *s;
int nSeg;
void Initialise(void);
void LoadFile(char *fn);
void EstimateModel(void);
void SaveModel(char *outfn);
if(InitShell(argc,argv,hinit_version,hinit_vc_id)<SUCCESS)
HError(2100,"HInit: InitShell failed");
InitMem(); InitLabel();
InitMath(); InitSigP();
InitWave(); InitAudio();
InitVQ(); InitModel();
if(InitParm()<SUCCESS)
HError(2100,"HInit: InitParm failed");
InitTrain(); InitUtil();
if (!InfoPrinted() && NumArgs() == 0)
ReportUsage();
if (NumArgs() == 0) Exit(0);
SetConfParms();
CreateHMMSet(&hset,&gstack,FALSE);
while (NextArg() == SWITCHARG) {
s = GetSwtArg();
if (strlen(s)!=1)
HError(2119,"HInit: Bad switch %s; must be single letter",s);
switch(s[0]){
case 'e':
epsilon = GetChkedFlt(0.0,1.0,s); break;
case 'g':
ignOutVec = FALSE; break;
case 'i':
maxIter = GetChkedInt(0,100,s); break;
case 'l':
if (NextArg() != STRINGARG)
HError(2119,"HInit: Segment label expected");
segLab = GetStrArg();
break;
case 'm':
minSeg = GetChkedInt(1,1000,s); break;
case 'n':
newModel = FALSE; break;
case 'o':
outfn = GetStrArg();
break;
case 'u':
SetuFlags(); break;
case 'v':
minVar = GetChkedFlt(0.0,10.0,s); break;
case 'w':
mixWeightFloor = MINMIX * GetChkedFlt(0.0,100000.0,s);
break;
case 'B':
saveBinary = TRUE;
break;
case 'F':
if (NextArg() != STRINGARG)
HError(2119,"HInit: Data File format expected");
if((dff = Str2Format(GetStrArg())) == ALIEN)
HError(-2189,"HInit: Warning ALIEN Data file format set");
break;
case 'G':
if (NextArg() != STRINGARG)
HError(2119,"HInit: Label File format expected");
if((lff = Str2Format(GetStrArg())) == ALIEN)
HError(-2189,"HInit: Warning ALIEN Label file format set");
break;
case 'H':
if (NextArg() != STRINGARG)
HError(2119,"HInit: HMM macro file name expected");
AddMMF(&hset,GetStrArg());
break;
case 'I':
if (NextArg() != STRINGARG)
HError(2119,"HInit: MLF file name expected");
LoadMasterFile(GetStrArg());
break;
case 'L':
if (NextArg()!=STRINGARG)
HError(2119,"HInit: Label file directory expected");
labDir = GetStrArg(); break;
case 'M':
if (NextArg()!=STRINGARG)
HError(2119,"HInit: Output macro file directory expected");
outDir = GetStrArg();
break;
case 'T':
if (NextArg() != INTARG)
HError(2119,"HInit: Trace value expected");
trace = GetChkedInt(0,01777,s);
break;
case 'X':
if (NextArg()!=STRINGARG)
HError(2119,"HInit: Label file extension expected");
labExt = GetStrArg(); break;
default:
HError(2119,"HInit: Unknown switch %s",s);
//.........这里部分代码省略.........
示例12: main
int main(int argc, char *argv[])
{
MPI_Comm CommWorld;
int rank;
int procCount;
int procToWatch;
Dictionary* dictionary;
ExtensionManager_Register* extensionMgr_Register;
Topology* nTopology;
ElementLayout* eLayout;
NodeLayout* nLayout;
MeshDecomp* decomp;
MeshLayout* ml;
Mesh* mesh;
Stream* stream;
/* Initialise MPI, get world info */
MPI_Init(&argc, &argv);
MPI_Comm_dup( MPI_COMM_WORLD, &CommWorld );
MPI_Comm_size(CommWorld, &procCount);
MPI_Comm_rank(CommWorld, &rank);
Base_Init( &argc, &argv );
DiscretisationGeometry_Init( &argc, &argv );
DiscretisationShape_Init( &argc, &argv );
DiscretisationMesh_Init( &argc, &argv );
stream = Journal_Register (Info_Type, "myStream");
procToWatch = argc >= 2 ? atoi(argv[1]) : 0;
dictionary = Dictionary_New();
Dictionary_Add( dictionary, "rank", Dictionary_Entry_Value_FromUnsignedInt( rank ) );
Dictionary_Add( dictionary, "numProcessors", Dictionary_Entry_Value_FromUnsignedInt( procCount ) );
Dictionary_Add( dictionary, "meshSizeI", Dictionary_Entry_Value_FromUnsignedInt( 7 ) );
Dictionary_Add( dictionary, "meshSizeJ", Dictionary_Entry_Value_FromUnsignedInt( 7 ) );
Dictionary_Add( dictionary, "meshSizeK", Dictionary_Entry_Value_FromUnsignedInt( 7 ) );
Dictionary_Add( dictionary, "allowUnusedCPUs", Dictionary_Entry_Value_FromBool( False ) );
Dictionary_Add( dictionary, "allowPartitionOnNode", Dictionary_Entry_Value_FromBool( True ) );
Dictionary_Add( dictionary, "allowUnbalancing", Dictionary_Entry_Value_FromBool( False ) );
Dictionary_Add( dictionary, "shadowDepth", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
nTopology = (Topology*)IJK6Topology_New( "IJK6Topology", dictionary );
eLayout = (ElementLayout*)ParallelPipedHexaEL_New( "PPHexaEL", 3, dictionary );
nLayout = (NodeLayout*)CornerNL_New( "CornerNL", dictionary, eLayout, nTopology );
decomp = (MeshDecomp*)HexaMD_New( "HexaMD", dictionary, MPI_COMM_WORLD, eLayout, nLayout );
ml = MeshLayout_New( "MeshLayout", eLayout, nLayout, decomp );
extensionMgr_Register = ExtensionManager_Register_New();
mesh = Mesh_New( "Mesh", ml, sizeof(Node), sizeof(Element), extensionMgr_Register, dictionary );
mesh->buildNodeLocalToGlobalMap = True;
mesh->buildNodeDomainToGlobalMap = True;
mesh->buildNodeGlobalToLocalMap = True;
mesh->buildNodeGlobalToDomainMap = True;
mesh->buildNodeNeighbourTbl = True;
mesh->buildNodeElementTbl = True;
mesh->buildElementLocalToGlobalMap = True;
mesh->buildElementDomainToGlobalMap = True;
mesh->buildElementGlobalToDomainMap = True;
mesh->buildElementGlobalToLocalMap = True;
mesh->buildElementNeighbourTbl = True;
mesh->buildElementNodeTbl = True;
Build( mesh, 0, False );
Initialise(mesh, 0, False );
if (rank == procToWatch)
{
Node_Index currElementNodesCount=0;
Node_Index* currElementNodes = NULL;
Element_Index element_dI = 0;
Node_Index refNode_eI = 0;
Node_Index node_Diagonal = 0;
Node_Index node_Diagonal_gI = 0;
// only use this while setting up the test
//Print(mesh, stream);
// Some tests involving RegularMeshUtils_GetDiagOppositeAcrossElementNodeIndex()
for (element_dI=0; element_dI < mesh->elementDomainCount; element_dI++) {
currElementNodes = mesh->elementNodeTbl[element_dI];
currElementNodesCount = mesh->elementNodeCountTbl[element_dI];
for (refNode_eI = 0; refNode_eI < currElementNodesCount; refNode_eI++ ) {
node_Diagonal = RegularMeshUtils_GetDiagOppositeAcrossElementNodeIndex(mesh, element_dI,
currElementNodes[refNode_eI]) ;
node_Diagonal_gI = Mesh_NodeMapDomainToGlobal( mesh, node_Diagonal );
//print message stating: Element #, curr node #, diag opp node #
printf("Element #: %d, Current Node #: %d, Diagonal Node #: %d, (%d) \n",
element_dI, currElementNodes[refNode_eI], node_Diagonal, node_Diagonal_gI);
}
//.........这里部分代码省略.........
示例13: tDigitalDataManager
//.........这里部分代码省略.........
&m_DigitalDataConfig,
SIGNAL(SimulatorEnabledChanged(bool)),
m_pNMEA0183,
SLOT(SetSimulatorEnabled(bool)) );
Connect(
&m_DigitalDataConfig,
SIGNAL(LocalTimeOffsetChanged(int)),
m_pNMEA0183,
SLOT(SetLocalTimeOffset(int)) );
Connect(
m_pNMEA0183,
SIGNAL(RequestExitAppRestart()),
this,
SIGNAL(RequestExitAppRestart()));
Connect(
m_pNMEA0183,
SIGNAL(RequestExitTestMode()),
this,
SIGNAL(RequestExitTestMode()));
Connect(
m_pNMEA0183,
SIGNAL(RequestExitBurnin()),
this,
SIGNAL(RequestExitBurnin()));
m_pNMEA0183->SetSimulatorEnabled(m_DigitalDataConfig.SimulatorEnabled());
m_pNMEA0183->SetLocalTimeOffset(m_DigitalDataConfig.LocalTimeOffset());
}
{
m_pSimulateDataEngine = new tSimulateDataEngine(*m_pNavigationDataEngine, m_DigitalDataConfig.SailingFeaturesAllowed());
RegisterDataEngine( DATA_ENGINE_SIMULATE, m_pSimulateDataEngine );
QVector<tDataType> simulatedTypes = m_pSimulateDataEngine->SimulatedDataTypes();
m_pActiveDataEngine->SetSimulationTypes(simulatedTypes);
}
{
int numEngines = tDigitalData::NumInstances(DATA_CATEGORY_ENGINE);
int numTanks = tDigitalData::NumInstances(DATA_CATEGORY_FUEL_TANK);
m_pFuelManagementEngine = new tFuelManagementEngine(numEngines, numTanks, *m_pFuelSettings);
Connect(m_pSourceSelection, SIGNAL(NumInstancesChanged(int)), m_pFuelManagementEngine, SLOT(OnNumberInstancesChanged(int)));
RegisterDataEngine( DATA_ENGINE_FUEL_MANAGEMENT, m_pFuelManagementEngine );
RegisterDataEngine( DATA_ENGINE_VESSEL_FUEL_MANAGEMENT, m_pFuelManagementEngine );
}
}
// Connection for tNMEA0183
Connect( m_pNMEA0183, SIGNAL( UtcTimeAndDateUpdated( const tDataId&, const QTime&, const QDate& ) ),
this, SLOT( OnUtcTimeAndDateUpdated(const tDataId&, const QTime&, const QDate& ) ) );
// Connect signal to be notified when a 0183 MOB is received
Connect(m_pNMEA0183, SIGNAL(MOBReceived(const tRCoord&, QString)), this, SIGNAL(MOBReceived(const tRCoord&, QString)));
// Create the virtual device objects
{
char iGpsSource;
if (m_pNMEA0183->GetIGPSSource(&iGpsSource))
{
m_pIGPSVirtualDevice = new tInternalGPSVirtualDevice(
iGpsSource,
m_NDP2k,
*m_pNMEA0183Settings,
*m_pNDP2kDataEngine );
}
if(m_DigitalDataConfig.Ndp2kNavVirtualDeviceAllowed() == true)
{
tNavigationVirtualDevice::tConfig config =
{
tNavigationVirtualDevice::tSailingFeaturesAllowed(m_DigitalDataConfig.SailingFeaturesAllowed())
};
m_pNavigationVirtualDevice = new tNavigationVirtualDevice(
m_NDP2k,
*m_pNavigationDataEngine,
*m_pNDP2kDataEngine,
config);
Connect( &m_DigitalDataConfig, SIGNAL(LocalTimeOffsetChanged(int)), m_pNavigationVirtualDevice, SLOT(SetLocalTimeOffset(int)) );
m_pNavigationVirtualDevice->SetLocalTimeOffset(m_DigitalDataConfig.LocalTimeOffset());
m_pNavigationVirtualDevice->Initialise();
}
// NMEA0183 Virtual Device(s)
QList<char> nmea0183Sources = m_pNMEA0183->Get0183Sources();
if(nmea0183Sources.size() > 0) // Port 1
{
m_pNMEA0183VirtualDevice1 = CreateAndConnectNMEA0183VirtualDevice(nmea0183Sources[0], tNDP2k::TxDeviceNmea0183Port1);
}
if(nmea0183Sources.size() > 1) // Port 2
{
m_pNMEA0183VirtualDevice2 = CreateAndConnectNMEA0183VirtualDevice(nmea0183Sources[1], tNDP2k::TxDeviceNmea0183Port2);
}
}
示例14: Initialise
Tree::Tree()
{
Initialise();
}
示例15: main
//.........这里部分代码省略.........
break;
case 'u':
SetuFlags();
break;
case 'v':
MSDthresh = GetChkedFlt(0.0, 1.0, s);
break;
case 'w':
fGVDistWght = GetChkedFlt(0.0, 1000.0, s);
break;
case 'x':
if (NextArg() != STRINGARG)
HError(6601, "HMgeTool: HMM file extension expected");
hmmExt = GetStrArg();
break;
case 'B':
inBinary = TRUE;
break;
case 'G':
mtInfo->nGainStreamIndex = GetChkedInt(1, SMAX, s);
mtInfo->nGainDimIndex = GetChkedInt(1, 1000, s);
if (NextArg() == FLOATARG || NextArg() == INTARG)
mtInfo->fGainWghtComp = GetChkedFlt(-10000.0, 1000000.0, s);
break;
case 'H':
if (NextArg() != STRINGARG)
HError(6601, "HMgeTool: HMM macro file name expected");
mmfFn = GetStrArg();
AddMMF(&hset, mmfFn);
break;
case 'I':
if (NextArg() != STRINGARG)
HError(6601, "HMgeTool: MLF file name expected");
LoadMasterFile(GetStrArg());
break;
case 'J': /* regression class and tree */
if (NextArg() != STRINGARG)
HError(6601, "HMgeTool: HMM regression class/tree file name expected");
s = GetStrArg();
AddMMF(&hset, s);
AddMMF(&orighset, s);
break;
case 'K':
if (NextArg() != STRINGARG)
HError(6601, "HMgeTool: HMM transform file name expected");
xformfn = GetStrArg();
break;
case 'L':
if (NextArg() != STRINGARG)
HError(6601, "HMgeTool: Label file directory expected");
labDir = GetStrArg();
break;
case 'M':
if (NextArg() != STRINGARG)
HError(6601, "HMgeTool: Output macro file directory expected");
outDir = GetStrArg();
break;
case 'T':
trace = GetChkedInt(0, 0100000, s);
break;
case 'X':
if (NextArg() != STRINGARG)
HError(2319, "HMGenS: Label file extension expected");
labExt = GetStrArg();
break;
default:
HError(6601, "HMgeTool: Unknown switch %s", s);
}
}
if (NextArg() != STRINGARG)
HError(6601, "HMgeTool: file name of model list expected");
hmmListFn = GetStrArg();
Initialise();
if (funcType == MGE_EVAL) {
PerformMgeEval();
} else if (funcType == MGE_TRAIN) {
PerformMgeTrain();
if (endIter > 0 && bMgeUpdate) {
/* output HMM files */
ConvDiagC(&hset, TRUE);
SaveHMMSet(&hset, outDir, outExt, NULL, inBinary);
}
} else if (funcType == MGE_ADAPT) {
PerformMgeAdapt();
if (endIter > 0 && bMgeUpdate) {
MakeFN(xformfn, outDir, NULL, fname);
SaveOneXForm(&hset, hset.curXForm, fname, FALSE);
}
}
ResetHeap(&hmmStack);
ResetHeap(&orighmmStack);
ResetHeap(&accStack);
ResetHeap(&genStack);
ResetHeap(&mgeStack);
return 0;
}