本文整理汇总了C++中Initialize函数的典型用法代码示例。如果您正苦于以下问题:C++ Initialize函数的具体用法?C++ Initialize怎么用?C++ Initialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Initialize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
swq_expr_node::swq_expr_node()
{
Initialize();
}
示例2: main
int main(int argc, char* argv[])
{
#ifdef Q_WS_X11
QCoreApplication::setAttribute(Qt::AA_X11InitThreads);
#endif
QGuiApplication app(argc,argv);
SettingsRef settings;
MainWindow *window;
int result;
#ifdef __UBUNTU__
QString appId = getenv("APP_ID");
appId = appId.split("_")[0];
#else
QString appId = "osmscout.fransschreuder";
#endif
app.setOrganizationName(appId);
app.setOrganizationDomain(appId);
app.setApplicationName(appId.split(".")[0]);
QTranslator qtTranslator;
qtTranslator.load("qt_" + QLocale::system().name(),
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);
QTranslator myappTranslator;
myappTranslator.load("osmscout_" + QLocale::system().name(), ":/po");
app.installTranslator(&myappTranslator);
//qRegisterMetaType<RenderMapRequest>();
qRegisterMetaType<DatabaseLoadedResponse>();
qmlRegisterType<MapWidget>("net.sf.libosmscout.map", 1, 0, "Map");
qmlRegisterType<Location>("net.sf.libosmscout.map", 1, 0, "Location");
qmlRegisterType<LocationListModel>("net.sf.libosmscout.map", 1, 0, "LocationListModel");
qmlRegisterType<RouteStep>("net.sf.libosmscout.map", 1, 0, "RouteStep");
qmlRegisterType<RoutingListModel>("net.sf.libosmscout.map", 1, 0, "RoutingListModel");
qmlRegisterType<MapListModel>("net.sf.libosmscout.map", 1, 0, "MapListModel");
qmlRegisterType<DownloadListModel>("net.sf.libosmscout.map", 1, 0, "DownloadListModel");
qmlRegisterType<DownloadDirListModel>("net.sf.libosmscout.map", 1, 0, "DownloadDirListModel");
qmlRegisterSingletonType<Theme>("net.sf.libosmscout.map", 1, 0, "Theme", ThemeProvider);
qmlRegisterType<DownloadManager>("net.sf.libosmscout.map", 1, 0, "DownloadManager");
qmlRegisterType<UnityScreen>("net.sf.libosmscout.map", 1, 0, "UnityScreen");
osmscout::log.Debug(true);
QThread thread;
if (!DBThread::InitializeInstance()) {
std::cerr << "Cannot initialize DBThread" << std::endl;
}
DBThread* dbThread=DBThread::GetInstance();
window=new MainWindow(settings,
dbThread);
dbThread->connect(&thread, SIGNAL(started()), SLOT(Initialize()));
dbThread->connect(&thread, SIGNAL(finished()), SLOT(Finalize()));
dbThread->moveToThread(&thread);
thread.start();
result=app.exec();
delete window;
thread.quit();
thread.wait();
DBThread::FreeInstance();
return result;
}
示例3: Initialize
//
// инициализация COM порта
//
BOOL CComPort::Initialize(DWORD baud,BYTE parity,BYTE stopbit)
{ //не изменяем сост. линий
return Initialize(baud,parity,stopbit,-1,-1);
}
示例4: npc_floonAI
npc_floonAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
m_uiNormFaction = creature->getFaction();
}
示例5: npc_unkor_the_ruthlessAI
npc_unkor_the_ruthlessAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
示例6: instance_dark_portal
instance_dark_portal(Map *map) : ScriptedInstance(map) {Initialize();};
示例7: raLogfile
Log::Log() :
raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL),
dberLogfile(NULL), m_colored(false), m_includeTime(false), m_gmlog_per_account(false)
{
Initialize();
}
示例8: CMenuPanel
//.........这里部分代码省略.........
SchemeHandle_t hTeamWindowText = pSchemes->getSchemeHandle("Briefing Text");
SchemeHandle_t hTeamInfoText = pSchemes->getSchemeHandle("Team Info Text");
// get the Font used for the Titles
Font *pTitleFont = pSchemes->getFont(hTitleScheme);
int r, g, b, a;
// Create the title
Label *pLabel = new Label("", TEAMMENU_TITLE_X, TEAMMENU_TITLE_Y);
pLabel->setParent(this);
pLabel->setFont(pTitleFont);
pSchemes->getFgColor(hTitleScheme, r, g, b, a);
pLabel->setFgColor(r, g, b, a);
pSchemes->getBgColor(hTitleScheme, r, g, b, a);
pLabel->setBgColor(r, g, b, a);
pLabel->setContentAlignment(vgui::Label::a_west);
pLabel->setText("%s", gHUD.m_TextMessage.BufferedLocaliseTextString("#Title_SelectYourTeam"));
// Create the Info Window
m_pTeamWindow = new CTransparentPanel(255, TEAMMENU_WINDOW_X, TEAMMENU_WINDOW_Y, TEAMMENU_WINDOW_SIZE_X, TEAMMENU_WINDOW_SIZE_Y);
m_pTeamWindow->setParent(this);
m_pTeamWindow->setBorder(new LineBorder(Color(255 * 0.7, 170 * 0.7, 0, 0)));
// Create the Map Name Label
m_pMapTitle = new Label("", TEAMMENU_WINDOW_TITLE_X, TEAMMENU_WINDOW_TITLE_Y);
m_pMapTitle->setFont(pTitleFont);
m_pMapTitle->setParent(m_pTeamWindow);
pSchemes->getFgColor(hTitleScheme, r, g, b, a);
m_pMapTitle->setFgColor(r, g, b, a);
pSchemes->getBgColor(hTitleScheme, r, g, b, a);
m_pMapTitle->setBgColor(r, g, b, a);
m_pMapTitle->setContentAlignment(vgui::Label::a_west);
// Create the Scroll panel
m_pScrollPanel = new CTFScrollPanel(TEAMMENU_WINDOW_TEXT_X, TEAMMENU_WINDOW_TEXT_Y, TEAMMENU_WINDOW_SIZE_X - (TEAMMENU_WINDOW_TEXT_X * 2), TEAMMENU_WINDOW_TEXT_SIZE_Y);
m_pScrollPanel->setParent(m_pTeamWindow);
m_pScrollPanel->setScrollBarVisible(false, false);
// Create the Map Briefing panel
m_pBriefing = new TextPanel("", 0, 0, TEAMMENU_WINDOW_SIZE_X - TEAMMENU_WINDOW_TEXT_X, TEAMMENU_WINDOW_TEXT_SIZE_Y);
m_pBriefing->setParent(m_pScrollPanel->getClient());
m_pBriefing->setFont(pSchemes->getFont(hTeamWindowText));
pSchemes->getFgColor(hTeamWindowText, r, g, b, a);
m_pBriefing->setFgColor(r, g, b, a);
pSchemes->getBgColor(hTeamWindowText, r, g, b, a);
m_pBriefing->setBgColor(r, g, b, a);
m_pBriefing->setText(gHUD.m_TextMessage.BufferedLocaliseTextString("#Map_Description_not_available"));
// Team Menu buttons
for(int i = 1; i <= 5; i++)
{
char sz[256];
int iYPos = TEAMMENU_TOPLEFT_BUTTON_Y + ((TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y) * i);
// Team button
m_pButtons[i] = new CommandButton("", TEAMMENU_TOPLEFT_BUTTON_X, iYPos, TEAMMENU_BUTTON_SIZE_X, TEAMMENU_BUTTON_SIZE_Y, true);
m_pButtons[i]->setParent(this);
m_pButtons[i]->setContentAlignment(vgui::Label::a_west);
m_pButtons[i]->setVisible(false);
// AutoAssign button uses special case
if(i == 5)
{
m_pButtons[5]->setBoundKey('5');
m_pButtons[5]->setText(gHUD.m_TextMessage.BufferedLocaliseTextString("#Team_AutoAssign"));
m_pButtons[5]->setVisible(true);
}
// Create the Signals
sprintf(sz, "jointeam %d", i);
m_pButtons[i]->addActionSignal(new CMenuHandler_StringCommandWatch(sz, true));
m_pButtons[i]->addInputSignal(new CHandler_MenuButtonOver(this, i));
// Create the Team Info panel
m_pTeamInfoPanel[i] = new TextPanel("", TEAMMENU_WINDOW_INFO_X, TEAMMENU_WINDOW_INFO_Y, TEAMMENU_WINDOW_SIZE_X - TEAMMENU_WINDOW_INFO_X, TEAMMENU_WINDOW_SIZE_X - TEAMMENU_WINDOW_INFO_Y);
m_pTeamInfoPanel[i]->setParent(m_pTeamWindow);
m_pTeamInfoPanel[i]->setFont(pSchemes->getFont(hTeamInfoText));
m_pTeamInfoPanel[i]->setFgColor(iTeamColors[i % iNumberOfTeamColors][0],
iTeamColors[i % iNumberOfTeamColors][1],
iTeamColors[i % iNumberOfTeamColors][2],
0);
m_pTeamInfoPanel[i]->setBgColor(0, 0, 0, 255);
}
// Create the Cancel button
m_pCancelButton = new CommandButton(CHudTextMessage::BufferedLocaliseTextString("#Menu_Cancel"), TEAMMENU_TOPLEFT_BUTTON_X, 0, TEAMMENU_BUTTON_SIZE_X, TEAMMENU_BUTTON_SIZE_Y);
m_pCancelButton->setParent(this);
m_pCancelButton->addActionSignal(new CMenuHandler_TextWindow(HIDE_TEXTWINDOW));
// Create the Spectate button
m_pSpectateButton = new SpectateButton(CHudTextMessage::BufferedLocaliseTextString("#Menu_Spectate"), TEAMMENU_TOPLEFT_BUTTON_X, 0, TEAMMENU_BUTTON_SIZE_X, TEAMMENU_BUTTON_SIZE_Y, true);
m_pSpectateButton->setParent(this);
m_pSpectateButton->addActionSignal(new CMenuHandler_StringCommand("spectate", true));
m_pSpectateButton->setBoundKey('6');
m_pSpectateButton->addInputSignal(new CHandler_MenuButtonOver(this, 6));
Initialize();
}
示例9: ScriptedInstance
instance_gruuls_lair::instance_gruuls_lair(Map *pMap) : ScriptedInstance(pMap),
m_uiCouncilMembersDied(0)
{
Initialize();
}
示例10: AP4_SUCCEEDED
/*----------------------------------------------------------------------
| AP4_Processor::Process
+---------------------------------------------------------------------*/
AP4_Result
AP4_Processor::Process(AP4_ByteStream& input,
AP4_ByteStream& output,
ProgressListener* listener,
AP4_AtomFactory& atom_factory)
{
// read all atoms.
// keep all atoms except [mdat]
// keep a ref to [moov]
// put [moof] atoms in a separate list
AP4_AtomParent top_level;
AP4_MoovAtom* moov = NULL;
AP4_ContainerAtom* mfra = NULL;
AP4_List<AP4_MoofLocator> moofs;
AP4_UI64 stream_offset = 0;
for (AP4_Atom* atom = NULL;
AP4_SUCCEEDED(atom_factory.CreateAtomFromStream(input, atom));
input.Tell(stream_offset)) {
if (atom->GetType() == AP4_ATOM_TYPE_MDAT) {
continue;
} else if (atom->GetType() == AP4_ATOM_TYPE_MOOV) {
moov = AP4_DYNAMIC_CAST(AP4_MoovAtom, atom);
} else if (atom->GetType() == AP4_ATOM_TYPE_MOOF) {
AP4_ContainerAtom* moof = AP4_DYNAMIC_CAST(AP4_ContainerAtom, atom);
if (moof) {
moofs.Add(new AP4_MoofLocator(moof, stream_offset));
}
continue;
} else if (atom->GetType() == AP4_ATOM_TYPE_MFRA) {
mfra = AP4_DYNAMIC_CAST(AP4_ContainerAtom, atom);
continue;
}
top_level.AddChild(atom);
}
// initialize the processor
AP4_Result result = Initialize(top_level, input);
if (AP4_FAILED(result)) return result;
// process the tracks if we have a moov atom
AP4_Array<AP4_SampleLocator> locators;
AP4_Cardinal track_count = 0;
AP4_List<AP4_TrakAtom>* trak_atoms = NULL;
AP4_LargeSize mdat_payload_size = 0;
TrackHandler** handlers = NULL;
AP4_SampleCursor* cursors = NULL;
if (moov) {
// build an array of track sample locators
trak_atoms = &moov->GetTrakAtoms();
track_count = trak_atoms->ItemCount();
cursors = new AP4_SampleCursor[track_count];
handlers = new TrackHandler*[track_count];
for (AP4_Ordinal i=0; i<track_count; i++) {
handlers[i] = NULL;
}
unsigned int index = 0;
for (AP4_List<AP4_TrakAtom>::Item* item = trak_atoms->FirstItem(); item; item=item->GetNext()) {
AP4_TrakAtom* trak = item->GetData();
// find the stsd atom
AP4_ContainerAtom* stbl = AP4_DYNAMIC_CAST(AP4_ContainerAtom, trak->FindChild("mdia/minf/stbl"));
if (stbl == NULL) continue;
// see if there's an external data source for this track
AP4_ByteStream* trak_data_stream = &input;
for (AP4_List<ExternalTrackData>::Item* ditem = m_ExternalTrackData.FirstItem(); ditem; ditem=ditem->GetNext()) {
ExternalTrackData* tdata = ditem->GetData();
if (tdata->m_TrackId == trak->GetId()) {
trak_data_stream = tdata->m_MediaData;
break;
}
}
// create the track handler
handlers[index] = CreateTrackHandler(trak);
cursors[index].m_Locator.m_TrakIndex = index;
cursors[index].m_Locator.m_SampleTable = new AP4_AtomSampleTable(stbl, *trak_data_stream);
cursors[index].m_Locator.m_SampleIndex = 0;
cursors[index].m_Locator.m_ChunkIndex = 0;
if (cursors[index].m_Locator.m_SampleTable->GetSampleCount()) {
cursors[index].m_Locator.m_SampleTable->GetSample(0, cursors[index].m_Locator.m_Sample);
} else {
cursors[index].m_EndReached = true;
}
index++;
}
// figure out the layout of the chunks
for (;;) {
// see which is the next sample to write
AP4_UI64 min_offset = (AP4_UI64)(-1);
int cursor = -1;
for (unsigned int i=0; i<track_count; i++) {
if (!cursors[i].m_EndReached &&
cursors[i].m_Locator.m_Sample.GetOffset() <= min_offset) {
//.........这里部分代码省略.........
示例11: ScriptedInstance
instance_the_eye::instance_the_eye(Map* pMap) : ScriptedInstance(pMap),
m_uiKaelthasEventPhase(0)
{
Initialize();
}
示例12: m_pMap
Unit::Unit(bool bPlayer /*= false*/)
: m_pMap(nullptr), m_pRegion(nullptr), m_sRegionX(0), m_sRegionZ(0), m_bPlayer(bPlayer)
{
Initialize();
}
示例13: boss_CrushtoAI
boss_CrushtoAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
示例14: instance_scarlet_monastery
instance_scarlet_monastery(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
示例15: boss_shirrak_the_dead_watcherAI
boss_shirrak_the_dead_watcherAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}