当前位置: 首页>>代码示例>>C++>>正文


C++ DatabasePtr::getServer方法代码示例

本文整理汇总了C++中DatabasePtr::getServer方法的典型用法代码示例。如果您正苦于以下问题:C++ DatabasePtr::getServer方法的具体用法?C++ DatabasePtr::getServer怎么用?C++ DatabasePtr::getServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatabasePtr的用法示例。


在下文中一共展示了DatabasePtr::getServer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DeploymentException

 ServerProxyWrapper(const DatabasePtr& database, const string& id) : _id(id)
 {
     try
     {
         _proxy = database->getServer(_id)->getProxy(_activationTimeout, _deactivationTimeout, _node, false, 5);
     }
     catch(const SynchronizationException&)
     {
         throw DeploymentException("server is being updated");
     }
 }
开发者ID:zmyer,项目名称:ice,代码行数:11,代码来源:AdminI.cpp

示例2: databaseName

RestoreFrame::RestoreFrame(wxWindow* parent, DatabasePtr db)
    : BackupRestoreBaseFrame(parent, db)
{
    setIdString(this, getFrameId(db));

    wxString databaseName(db->getName_());
    wxString serverName(db->getServer()->getName_());
    SetTitle(wxString::Format(_("Restore Database \"%s:%s\""),
        serverName.c_str(), databaseName.c_str()));

    createControls();
    layoutControls();
    updateControls();

    text_ctrl_filename->SetFocus();
}
开发者ID:AlfiyaZi,项目名称:flamerobin,代码行数:16,代码来源:RestoreFrame.cpp

示例3: OnStartButtonClick

void RestoreFrame::OnStartButtonClick(wxCommandEvent& WXUNUSED(event))
{
    verboseMsgsM = checkbox_showlog->IsChecked();
    clearLog();

    DatabasePtr database = getDatabase();
    wxCHECK_RET(database,
        "Cannot restore unassigned database");
    ServerPtr server = database->getServer();
    wxCHECK_RET(server,
        "Cannot restore database without assigned server");

    wxString username;
    wxString password;
    if (!getConnectionCredentials(this, database, username, password))
        return;

    int flags = (int)IBPP::brVerbose; // this will be ORed in anyway
    if (checkbox_replace->IsChecked())
        flags |= (int)IBPP::brReplace;
    if (checkbox_deactivate->IsChecked())
        flags |= (int)IBPP::brDeactivateIdx;
    if (checkbox_noshadow->IsChecked())
        flags |= (int)IBPP::brNoShadow;
    if (checkbox_validity->IsChecked())
        flags |= (int)IBPP::brNoValidity;
    if (checkbox_commit->IsChecked())
        flags |= (int)IBPP::brPerTableCommit;
    if (checkbox_space->IsChecked())
        flags |= (int)IBPP::brUseAllSpace;

    unsigned long pagesize;
    if (!choice_pagesize->GetStringSelection().ToULong(&pagesize))
        pagesize = 0;

    std::auto_ptr<wxThread> thread(new RestoreThread(this,
        server->getConnectionString(), username, password,
        text_ctrl_filename->GetValue(), database->getPath(), pagesize,
        (IBPP::BRF)flags));
    startThread(thread);
    updateControls();
}
开发者ID:AlfiyaZi,项目名称:flamerobin,代码行数:42,代码来源:RestoreFrame.cpp

示例4: handleURI

bool DatabaseInfoHandler::handleURI(URI& uri)
{
    bool isEditSweep, isEditForcedWrites, isEditReserve, isEditReadOnly,
        isEditPageBuffers;

    isEditSweep = (uri.action == "edit_db_sweep_interval");
    isEditForcedWrites = (uri.action == "edit_db_forced_writes");
    isEditReserve = (uri.action == "edit_db_reserve_space");
    isEditReadOnly = (uri.action == "edit_db_read_only");
    isEditPageBuffers = (uri.action == "edit_db_page_buffers");

    if (!isEditSweep && !isEditForcedWrites && !isEditReserve
        && !isEditReadOnly && !isEditPageBuffers)
    {
        return false;
    }

    DatabasePtr d = extractMetadataItemPtrFromURI<Database>(uri);
    wxWindow* w = getParentWindow(uri);

    // when either the database or the window does not exist
    // return immediately. Because this function returns whether
    // the specified uri is handled, return true.
    if (!d || !w || !d->isConnected())
         return true;

    IBPP::Database& db = d->getIBPPDatabase();
    IBPP::Service svc = IBPP::ServiceFactory(
        wx2std(d->getServer()->getConnectionString()),
        db->Username(), db->UserPassword());
    svc->Connect();

    if (isEditSweep || isEditPageBuffers)
    {
        long oldValue = 0;
        wxString title, label;
        if (isEditSweep)
        {
            oldValue = d->getInfo().getSweep();
            title = _("Enter the new Sweep Interval");
            label = _("Sweep Interval"); 
        }
        else if (isEditPageBuffers)
        {
            oldValue = d->getInfo().getBuffers();
            title = _("Enter the new value for Page Buffers");
            label = _("Page Buffers"); 
        }

        while (true)
        {
            wxString s;
            long value = oldValue;
            s = ::wxGetTextFromUser(title, label,
                wxString::Format("%d", value), w);

            // return from the iteration when the entered string is empty, in
            // case of cancelling the operation.
            if (s.IsEmpty())
                break;
            if (!s.ToLong(&value))
                continue;
            // return from the iteration when the interval has not changed
            if (value == oldValue)
                break;

            if (isEditSweep)
                svc->SetSweepInterval(wx2std(d->getPath()), value);
            else if (isEditPageBuffers)
                svc->SetPageBuffers(wx2std(d->getPath()), value);

            // Before reloading the info, re-attach to the database
            // otherwise the sweep interval won't be changed for FB Classic
            // Server.
            db->Disconnect();
            db->Connect();
            d->loadInfo();
            break;
        }
    }

    else if (isEditForcedWrites || isEditReserve || isEditReadOnly)
    {
        bool fw = !d->getInfo().getForcedWrites();
        bool reserve = !d->getInfo().getReserve();
        bool ro = !d->getInfo().getReadOnly();

        // setting these properties requires that the database is
        // disconnected.
        db->Disconnect();

        if (isEditForcedWrites)
            svc->SetSyncWrite(wx2std(d->getPath()), fw);
        if (isEditReserve)
            svc->SetReserveSpace(wx2std(d->getPath()), reserve);
        if (isEditReadOnly)
            svc->SetReadOnly(wx2std(d->getPath()), ro);

        db->Connect();

//.........这里部分代码省略.........
开发者ID:AlfiyaZi,项目名称:flamerobin,代码行数:101,代码来源:databasehandler.cpp


注:本文中的DatabasePtr::getServer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。