您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ unconst函数代码示例

51自学网 2021-06-03 09:09:26
  C++
这篇教程C++ unconst函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中unconst函数的典型用法代码示例。如果您正苦于以下问题:C++ unconst函数的具体用法?C++ unconst怎么用?C++ unconst使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: LogFlowThisFunc

/** *  Initializes the Serial Port object given another serial port object *  (a kind of copy constructor). This object shares data with *  the object passed as an argument. * *  @note This object must be destroyed before the original object *  it shares data with is destroyed. * *  @note Locks @a aThat object for reading. */HRESULT SerialPort::init(Machine *aParent, SerialPort *aThat){    LogFlowThisFunc(("aParent=%p, aThat=%p/n", aParent, aThat));    ComAssertRet(aParent && aThat, E_INVALIDARG);    /* Enclose the state transition NotReady->InInit->Ready */    AutoInitSpan autoInitSpan(this);    AssertReturn(autoInitSpan.isOk(), E_FAIL);    m = new Data();    unconst(m->pMachine) = aParent;    unconst(m->pPeer) = aThat;    AutoCaller thatCaller (aThat);    AssertComRCReturnRC(thatCaller.rc());    AutoReadLock thatLock(aThat COMMA_LOCKVAL_SRC_POS);    m->bd.share (aThat->m->bd);    /* Confirm a successful initialization */    autoInitSpan.setSucceeded();    return S_OK;}
开发者ID:mcenirm,项目名称:vbox,代码行数:36,


示例2: LogFlowThisFunc

/** * Uninitializes the instance and sets the ready flag to FALSE. * Called either from FinalRelease() or by the parent when it gets destroyed. */void USBController::uninit(){    LogFlowThisFunc(("/n"));    /* Enclose the state transition Ready->InUninit->NotReady */    AutoUninitSpan autoUninitSpan(this);    if (autoUninitSpan.uninitDone())        return;#ifdef VBOX_WITH_USB    // uninit all device filters on the list (it's a standard std::list not an ObjectsList    // so we must uninit() manually)    for (DeviceFilterList::iterator it = m->llDeviceFilters->begin();         it != m->llDeviceFilters->end();         ++it)        (*it)->uninit();    m->llDeviceFilters.free();#endif    m->bd.free();    unconst(m->pPeer) = NULL;    unconst(m->pParent) = NULL;    delete m;    m = NULL;}
开发者ID:virendramishra,项目名称:VirtualBox4.1.18,代码行数:31,


示例3: LogFlowThisFunc

/** * Uninitializes the instance and sets the ready flag to FALSE. * * Called either from FinalRelease() or by the parent when it gets destroyed. */void Progress::uninit(){    LogFlowThisFunc(("/n"));    /* Enclose the state transition Ready->InUninit->NotReady */    AutoUninitSpan autoUninitSpan(this);    if (autoUninitSpan.uninitDone())        return;    /* wake up all threads still waiting on occasion */    if (mWaitersCount > 0)    {        LogFlow(("WARNING: There are still %d threads waiting for '%s' completion!/n",                 mWaitersCount, mDescription.c_str()));        RTSemEventMultiSignal(mCompletedSem);    }    RTSemEventMultiDestroy(mCompletedSem);    /* release initiator (effective only if mInitiator has been assigned in *      * init()) */    unconst(mInitiator).setNull();#if !defined(VBOX_COM_INPROC)    if (mParent)    {        /* remove the added progress on failure to complete the initialization */        if (autoUninitSpan.initFailed() && mId.isValid() && !mId.isZero())            mParent->i_removeProgress(mId.ref());        unconst(mParent) = NULL;    }#endif}
开发者ID:mcenirm,项目名称:vbox,代码行数:39,


示例4: autoInitSpan

HRESULT DHCPServer::init(VirtualBox *aVirtualBox,                         const settings::DHCPServer &data){    /* Enclose the state transition NotReady->InInit->Ready */    AutoInitSpan autoInitSpan(this);    AssertReturn(autoInitSpan.isOk(), E_FAIL);    /* share VirtualBox weakly (parent remains NULL so far) */    unconst(mVirtualBox) = aVirtualBox;    unconst(mName) = data.strNetworkName;    m->IPAddress = data.strIPAddress;    m->enabled = data.fEnabled;    m->lowerIP = data.strIPLower;    m->upperIP = data.strIPUpper;    m->GlobalDhcpOptions.clear();    m->GlobalDhcpOptions.insert(data.GlobalDhcpOptions.begin(),                               data.GlobalDhcpOptions.end());    m->VmSlot2Options.clear();    m->VmSlot2Options.insert(data.VmSlot2OptionsM.begin(),                            data.VmSlot2OptionsM.end());    autoInitSpan.setSucceeded();    return S_OK;}
开发者ID:miguelinux,项目名称:vbox,代码行数:28,


示例5: Data

 Data(Machine * const aMachine)     : pVirtualBox(NULL),       pSystemProperties(NULL),       pParent(aMachine) {     unconst(pVirtualBox) = aMachine->i_getVirtualBox();     unconst(pSystemProperties) = pVirtualBox->i_getSystemProperties(); }
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:8,


示例6: main

int main(void){	const int x = 10;	unconst(x) = 20;		//may not work	printf("%d/n", x);		int y = 10;	unconst(y) = 20;	printf("%d/n", y);		return 0;}
开发者ID:TakaakiUmedu,项目名称:misc,代码行数:11,


示例7: LogFlowThisFuncEnter

/** * Initializes the medium attachment object. * * @param aParent           Machine object. * @param aMedium           Medium object. * @param aControllerName   Controller the hard disk is attached to. * @param aPort             Port number. * @param aDevice           Device number on the port. * @param aType             Device type. * @param aImplicit * @param aPassthrough      Whether accesses are directly passed to the host drive. * @param aTempEject        Whether guest-triggered eject results in unmounting the medium. * @param aNonRotational    Whether this medium is non-rotational (aka SSD). * @param aDiscard          Whether this medium supports discarding unused blocks. * @param aHotPluggable     Whether this medium is hot-pluggable. * @param strBandwidthGroup Bandwidth group. */HRESULT MediumAttachment::init(Machine *aParent,                               Medium *aMedium,                               const Utf8Str &aControllerName,                               LONG aPort,                               LONG aDevice,                               DeviceType_T aType,                               bool aImplicit,                               bool aPassthrough,                               bool aTempEject,                               bool aNonRotational,                               bool aDiscard,                               bool aHotPluggable,                               const Utf8Str &strBandwidthGroup){    LogFlowThisFuncEnter();    LogFlowThisFunc(("aParent=%p aMedium=%p aControllerName=%s aPort=%d aDevice=%d aType=%d aImplicit=%d aPassthrough=%d aTempEject=%d aNonRotational=%d aDiscard=%d aHotPluggable=%d strBandwithGroup=%s/n", aParent, aMedium, aControllerName.c_str(), aPort, aDevice, aType, aImplicit, aPassthrough, aTempEject, aNonRotational, aDiscard, aHotPluggable, strBandwidthGroup.c_str()));    if (aType == DeviceType_HardDisk)        AssertReturn(aMedium, E_INVALIDARG);    /* Enclose the state transition NotReady->InInit->Ready */    AutoInitSpan autoInitSpan(this);    AssertReturn(autoInitSpan.isOk(), E_FAIL);    m = new Data();    unconst(m->pMachine) = aParent;    m->bd.allocate();    m->bd->pMedium = aMedium;    m->bd->mData.strBwGroup = strBandwidthGroup;    unconst(m->bd->strControllerName) = aControllerName;    m->bd->mData.lPort = aPort;    m->bd->mData.lDevice = aDevice;    m->bd->mData.deviceType = aType;    m->bd->mData.fPassThrough = aPassthrough;    m->bd->mData.fTempEject = aTempEject;    m->bd->mData.fNonRotational = aNonRotational;    m->bd->mData.fDiscard = aDiscard;    m->bd->fImplicit = aImplicit;    m->bd->mData.fHotPluggable = aHotPluggable;    /* Confirm a successful initialization when it's the case */    autoInitSpan.setSucceeded();    /* Construct a short log name for this attachment. */    i_updateLogName();    LogFlowThisFunc(("LEAVE - %s/n", i_getLogName()));    return S_OK;}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:69,


示例8: LogFlowThisFunc

/** *  Uninitializes the instance and sets the ready flag to FALSE. *  Called either from FinalRelease() or by the parent when it gets destroyed. */void AudioAdapter::uninit(){    LogFlowThisFunc(("/n"));    /* Enclose the state transition Ready->InUninit->NotReady */    AutoUninitSpan autoUninitSpan(this);    if (autoUninitSpan.uninitDone())        return;    mData.free();    unconst(mPeer) = NULL;    unconst(mParent) = NULL;}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:18,


示例9: LogFlowThisFunc

/** *  Uninitializes the instance and sets the ready flag to FALSE. *  Called either from FinalRelease() or by the parent when it gets destroyed. */void SharedFolder::uninit(){    LogFlowThisFunc(("/n"));    /* Enclose the state transition Ready->InUninit->NotReady */    AutoUninitSpan autoUninitSpan(this);    if (autoUninitSpan.uninitDone())        return;    unconst(mParent) = NULL;    unconst(mMachine) = NULL;    unconst(mConsole) = NULL;    unconst(mVirtualBox) = NULL;}
开发者ID:gvsurenderreddy,项目名称:VirtualBox-OSE,代码行数:19,


示例10: autoInitSpan

/** * VFSExplorer COM initializer. * @param * @return */HRESULT VFSExplorer::init(VFSType_T aType, Utf8Str aFilePath, Utf8Str aHostname, Utf8Str aUsername,                          Utf8Str aPassword, VirtualBox *aVirtualBox){    /* Enclose the state transition NotReady->InInit->Ready */    AutoInitSpan autoInitSpan(this);    AssertReturn(autoInitSpan.isOk(), E_FAIL);    /* Weak reference to a VirtualBox object */    unconst(mVirtualBox) = aVirtualBox;    /* initialize data */    m = new Data;    m->storageType = aType;    m->strPath = aFilePath;    m->strHostname = aHostname;    m->strUsername = aUsername;    m->strPassword = aPassword;    if (m->storageType == VFSType_S3)    {        size_t bpos = aFilePath.find("/", 1);        if (bpos != Utf8Str::npos)        {            m->strBucket = aFilePath.substr(1, bpos - 1); /* The bucket without any slashes */            aFilePath = aFilePath.substr(bpos); /* The rest of the file path */        }    }    /* Confirm a successful initialization */    autoInitSpan.setSucceeded();    return S_OK;}
开发者ID:svn2github,项目名称:virtualbox,代码行数:39,


示例11: unconst

/** * Initializes the object (called right after construction). * * @returns VBox status code. */int USBProxyBackendSolaris::init(USBProxyService *aUsbProxyService, const com::Utf8Str &strId, const com::Utf8Str &strAddress){    USBProxyBackend::init(aUsbProxyService, strId, strAddress);    unconst(m_strBackend) = Utf8Str("host");    /*     * Create semaphore.     */    int rc = RTSemEventCreate(&mNotifyEventSem);    if (RT_FAILURE(rc))        return rc;    /*     * Initialize the USB library.     */    rc = USBLibInit();    if (RT_FAILURE(rc))    {        /* mNotifyEventSem will be destroyed in uninit */        return rc;    }    mUSBLibInitialized = true;    /*     * Start the poller thread.     */    start();    return VINF_SUCCESS;}
开发者ID:svn2github,项目名称:virtualbox,代码行数:36,


示例12: unconst

/** * Returns generated tooltip for this medium. * * In "don't show diffs" mode (where the attributes of the base hard disk are * shown instead of the attributes of the differencing hard disk), extra * information will be added to the tooltip to give the user a hint that the * medium is actually a differencing hard disk. * * @param aNoDiffs  @c true to enable user-friendly "don't show diffs" mode. * @param aCheckRO  @c true to perform the #readOnly() check and add a notice *                  accordingly. */QString UIMedium::toolTip (bool aNoDiffs /* = false */, bool aCheckRO /* = false */, bool aNullAllowed /* = false */) const{    QString sTip;    if (mMedium.isNull())    {        sTip = aNullAllowed ? mRow.arg (VBoxGlobal::tr ("<b>No medium selected</b>", "medium")) +                              mRow.arg (VBoxGlobal::tr ("You can also change this while the machine is running.")) :                              mRow.arg (VBoxGlobal::tr ("<b>No media available</b>", "medium")) +                              mRow.arg (VBoxGlobal::tr ("You can create media images using the virtual media manager."));    }    else    {        unconst (this)->checkNoDiffs (aNoDiffs);        sTip = aNoDiffs ? mNoDiffs.toolTip : mToolTip;        if (aCheckRO && mIsReadOnly)            sTip += mRow.arg ("<hr>") +                    mRow.arg (VBoxGlobal::tr ("Attaching this hard disk will be performed indirectly using "                                              "a newly created differencing hard disk.", "medium"));    }    return mTable.arg (sTip);}
开发者ID:VirtualMonitor,项目名称:VirtualMonitor,代码行数:37,


示例13: LogFlowThisFunc

/** * Initializes the USB devic filters object given another USB filters object * (a kind of copy constructor). This object shares data with * the object passed as an argument. * * @returns COM result indicator. * @param aParent       Pointer to our parent object. * @param aPeer         The object to share. * * @note This object must be destroyed before the original object * it shares data with is destroyed. */HRESULT USBDeviceFilters::init(Machine *aParent, USBDeviceFilters *aPeer){    LogFlowThisFunc(("aParent=%p, aPeer=%p/n", aParent, aPeer));    ComAssertRet(aParent && aPeer, E_INVALIDARG);    /* Enclose the state transition NotReady->InInit->Ready */    AutoInitSpan autoInitSpan(this);    AssertReturn(autoInitSpan.isOk(), E_FAIL);    m = new Data(aParent);    unconst(m->pPeer) = aPeer;    AutoWriteLock thatlock(aPeer COMMA_LOCKVAL_SRC_POS);#ifdef VBOX_WITH_USB    /* create copies of all filters */    m->llDeviceFilters.allocate();    DeviceFilterList::const_iterator it = aPeer->m->llDeviceFilters->begin();    while (it != aPeer->m->llDeviceFilters->end())    {        ComObjPtr<USBDeviceFilter> pFilter;        pFilter.createObject();        pFilter->init(this, *it);        m->llDeviceFilters->push_back(pFilter);        ++it;    }#endif /* VBOX_WITH_USB */    /* Confirm a successful initialization */    autoInitSpan.setSucceeded();    return S_OK;}
开发者ID:mcenirm,项目名称:vbox,代码行数:47,


示例14: LogFlowThisFunc

/** * Uninitializes the instance and sets the ready flag to FALSE. * Called either from FinalRelease() or by the parent when it gets destroyed. */void Guest::uninit(){    LogFlowThisFunc(("/n"));#ifdef VBOX_WITH_GUEST_CONTROL    /* Scope write lock as much as possible. */    {        /*         * Cleanup must be done *before* AutoUninitSpan to cancel all         * all outstanding waits in API functions (which hold AutoCaller         * ref counts).         */        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);        /* Clean up callback data. */        CallbackMapIter it;        for (it = mCallbackMap.begin(); it != mCallbackMap.end(); it++)            callbackDestroy(it->first);        /* Clear process map. */        mGuestProcessMap.clear();    }#endif    /* Enclose the state transition Ready->InUninit->NotReady */    AutoUninitSpan autoUninitSpan(this);    if (autoUninitSpan.uninitDone())        return;    unconst(mParent) = NULL;}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:35,


示例15: LogFlowThisFunc

/** *  Initializes the USB device filter object (short version). * *  @param aParent  Handle of the parent object. */HRESULT HostUSBDeviceFilter::init(Host *aParent, IN_BSTR aName){    LogFlowThisFunc(("aParent=%p/n", aParent));    ComAssertRet(aParent && aName && *aName, E_INVALIDARG);    /* Enclose the state transition NotReady->InInit->Ready */    AutoInitSpan autoInitSpan(this);    AssertReturn(autoInitSpan.isOk(), E_FAIL);    unconst(mParent) = aParent;    /* register with parent early, since uninit() will unconditionally     * unregister on failure */    mParent->i_addChild(this);    bd.allocate();    bd->mData.strName = Utf8Str(aName);    bd->mData.fActive = FALSE;    mInList = false;    USBFilterInit(&bd->mUSBFilter, USBFILTERTYPE_IGNORE);    bd->mRemote = NULL;    bd->mData.ulMaskedInterfaces = 0;    /* Confirm successful initialization */    autoInitSpan.setSucceeded();    return S_OK;}
开发者ID:svn2github,项目名称:virtualbox,代码行数:35,


示例16: autoCaller

/** *  Cancels sharing (if any) by making an independent copy of data. *  This operation also resets this object's peer to NULL. * *  @note Locks this object for writing, together with the peer object *  represented by @a aThat (locked for reading). */void USBDeviceFilter::unshare(){    /* sanity */    AutoCaller autoCaller(this);    AssertComRCReturnVoid(autoCaller.rc());    /* sanity too */    AutoCaller peerCaller(mPeer);    AssertComRCReturnVoid(peerCaller.rc());    /* peer is not modified, lock it for reading (mPeer is "master" so locked     * first) */    AutoReadLock rl(mPeer COMMA_LOCKVAL_SRC_POS);    AutoWriteLock wl(this COMMA_LOCKVAL_SRC_POS);    if (bd.isShared())    {        if (!bd.isBackedUp())            bd.backup();        bd.commit();    }    unconst(mPeer) = NULL;}
开发者ID:svn2github,项目名称:virtualbox,代码行数:32,


示例17: AssertPtrReturn

/** * Waits for a formerly registered guest event. * * @return  IPRT status code. * @param   pEvent                  Pointer to event to wait for. * @param   uTimeoutMS              Timeout (in ms) for waiting. * @param   pType                   Event type of following IEvent. *                                  Optional. * @param   ppEvent                 Pointer to IEvent which got triggered *                                  for this event. Optional. */int GuestBase::waitForEvent(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,                            VBoxEventType_T *pType, IEvent **ppEvent){    AssertPtrReturn(pEvent, VERR_INVALID_POINTER);    /* pType is optional. */    /* ppEvent is optional. */    int vrc = pEvent->Wait(uTimeoutMS);    if (RT_SUCCESS(vrc))    {        const ComPtr<IEvent> pThisEvent = pEvent->Event();        if (!pThisEvent.isNull()) /* Having a VBoxEventType_ event is optional. */        {            if (pType)            {                HRESULT hr = pThisEvent->COMGETTER(Type)(pType);                if (FAILED(hr))                    vrc = VERR_COM_UNEXPECTED;            }            if (   RT_SUCCESS(vrc)                && ppEvent)                pThisEvent.queryInterfaceTo(ppEvent);            unconst(pThisEvent).setNull();        }    }    return vrc;}
开发者ID:bayasist,项目名称:vbox,代码行数:40,


示例18: LogFlowThisFunc

/** * Initializes the machine debugger object. * * @returns COM result indicator * @param aParent handle of our parent object */HRESULT MachineDebugger::init(Console *aParent){    LogFlowThisFunc(("aParent=%p/n", aParent));    ComAssertRet(aParent, E_INVALIDARG);    /* Enclose the state transition NotReady->InInit->Ready */    AutoInitSpan autoInitSpan(this);    AssertReturn(autoInitSpan.isOk(), E_FAIL);    unconst(mParent) = aParent;    for (unsigned i = 0; i < RT_ELEMENTS(maiQueuedEmExecPolicyParams); i++)        maiQueuedEmExecPolicyParams[i] = UINT8_MAX;    mSingleStepQueued = -1;    mRecompileUserQueued = -1;    mRecompileSupervisorQueued = -1;    mPatmEnabledQueued = -1;    mCsamEnabledQueued = -1;    mLogEnabledQueued = -1;    mVirtualTimeRateQueued = UINT32_MAX;    mFlushMode = false;    /* Confirm a successful initialization */    autoInitSpan.setSucceeded();    return S_OK;}
开发者ID:svn2github,项目名称:virtualbox,代码行数:34,


示例19: LogFlowThisFunc

/** * Uninitializes the instance and sets the ready flag to FALSE. * Called either from FinalRelease() or by the parent when it gets destroyed. */void BandwidthGroup::uninit(){    LogFlowThisFunc(("/n"));    /* Enclose the state transition Ready->InUninit->NotReady */    AutoUninitSpan autoUninitSpan(this);    if (autoUninitSpan.uninitDone())        return;    m->bd.free();    unconst(m->pPeer) = NULL;    unconst(m->pParent) = NULL;    delete m;    m = NULL;}
开发者ID:jeppeter,项目名称:vbox,代码行数:21,



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


C++ undefinedp函数代码示例
C++ uncompress函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。