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

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

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

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

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

示例1: CS_ASSERT

        //-------------------------------------------------------------		//-------------------------------------------------------------		void Entity::AddComponent(const ComponentSPtr& in_component)		{            CS_ASSERT(in_component != nullptr, "Cannot add null component");            CS_ASSERT(in_component->GetEntity() == nullptr, "Component cannot be attached to more than 1 entity at a time.");                        m_components.push_back(in_component);                        in_component->SetEntity(this);                        in_component->OnAddedToEntity();                        if(GetScene() != nullptr)            {                in_component->OnAddedToScene();                if (m_appActive == true)                {                    in_component->OnResume();                    if (m_appForegrounded == true)                    {                        in_component->OnForeground();                    }                }            }		}
开发者ID:mclaughlinhugh4,项目名称:ChilliSource,代码行数:26,


示例2: CS_ASSERT

 //------------------------------------------------------------------------------ void GLMesh::BuildMesh(const u8* vertexData, u32 vertexDataSize, const u8* indexData, u32 indexDataSize) noexcept {     CS_ASSERT(vertexDataSize > 0 && vertexData, "Cannot build mesh with empty data");          glGenBuffers(1, &m_vertexBufferHandle);     CS_ASSERT(m_vertexBufferHandle != 0, "Invalid vertex buffer.");          if(indexData)     {         glGenBuffers(1, &m_indexBufferHandle);         CS_ASSERT(m_indexBufferHandle != 0, "Invalid index buffer.");     }          glBindBuffer(GL_ARRAY_BUFFER, m_vertexBufferHandle);     glBufferData(GL_ARRAY_BUFFER, vertexDataSize, vertexData, GL_STATIC_DRAW);          if(indexData)     {         glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_indexBufferHandle);         glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexDataSize, indexData, GL_STATIC_DRAW);     }          CS_ASSERT_NOGLERROR("An OpenGL error occurred while creating GLMesh."); }
开发者ID:AzCopey,项目名称:ChilliSource,代码行数:25,


示例3: CS_ASSERT

 //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- void StandardDrawable::Draw(Rendering::CanvasRenderer* in_renderer, const Core::Matrix3& in_transform, const Core::Vector2& in_absSize, const Core::Colour& in_absColour) {     CS_ASSERT(m_texture != nullptr, "StandardDrawable cannot draw without texture");          //When textures are packed into an atlas their alpha space is cropped. This functionality restores the alpha space by resizing and offsetting the box.     Core::Vector2 offsetTL     (         (-m_atlasFrame.m_originalSize.x * 0.5f) + (m_atlasFrame.m_croppedSize.x * 0.5f) + m_atlasFrame.m_offset.x,         (m_atlasFrame.m_originalSize.y * 0.5f) - (m_atlasFrame.m_croppedSize.y * 0.5f) - m_atlasFrame.m_offset.y     );     offsetTL = in_absSize/m_atlasFrame.m_originalSize * offsetTL;     Core::Vector2 size = in_absSize/m_atlasFrame.m_originalSize * m_atlasFrame.m_croppedSize;          in_renderer->DrawBox(in_transform, size, offsetTL, m_texture, m_atlasFrame.m_uvs, in_absColour * m_colour, Rendering::AlignmentAnchor::k_middleCentre); }
开发者ID:DNSMorgan,项目名称:ChilliSource,代码行数:17,


示例4: SndSysBasicStream

SndSysSpeexSoundStream::SndSysSpeexSoundStream (csRef<SndSysSpeexSoundData> pData,                                                 csSndSysSoundFormat *pRenderFormat,                                                 int Mode3D) : SndSysBasicStream(pRenderFormat, Mode3D), m_pSoundData(pData), header(0){  // Allocate an advance buffer  m_pCyclicBuffer = new SoundCyclicBuffer (    (m_RenderFormat.Bits/8 * m_RenderFormat.Channels) *       (m_RenderFormat.Freq * SPEEX_BUFFER_LENGTH_MULTIPLIER / 	SPEEX_BUFFER_LENGTH_DIVISOR));  CS_ASSERT(m_pCyclicBuffer!=0);  // Initialize speex stream.  ResetPosition(false);}
开发者ID:garinh,项目名称:cs,代码行数:15,


示例5: CS_ASSERT

csStringBase &csStringBase::Overwrite (size_t iPos, const csStringBase &iStr){  CS_ASSERT (iPos <= Size);  if (GetData() == 0 || iPos == Size)    return Append (iStr);  size_t const sl = iStr.Length ();  size_t const NewSize = iPos + sl;  ExpandIfNeeded (NewSize);  char* p = GetDataMutable();                 // GLOBAL NOTE *2*  memcpy (p + iPos, iStr.GetData (), sl + 1); // GLOBAL NOTE *1*  Size = NewSize;  return *this;}
开发者ID:garinh,项目名称:cs,代码行数:15,


示例6: m_desc

 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ Test::Test(const TestDesc& in_desc, const PassDelegate& in_passDelegate, const FailDelegate& in_failDelegate) noexcept     : m_desc(in_desc), m_passDelegate(in_passDelegate), m_failDelegate(in_failDelegate) {     CS_ASSERT(m_passDelegate, "A valid pass delegate must be supplied.");     CS_ASSERT(m_failDelegate, "A valid fail delegate must be supplied.");          m_taskScheduler = CS::Application::Get()->GetTaskScheduler();          m_timerEventConnection = m_timer.OpenConnection(in_desc.GetTimeoutSeconds(), [=]()     {         std::unique_lock<std::mutex> lock(m_mutex);                  if (m_active)         {             m_active = false;             m_timer.Stop();             m_timerEventConnection.reset();                          m_failDelegate("Timed out.");         }     });          m_timer.Start(); }
开发者ID:ChilliWorks,项目名称:CSTest,代码行数:26,


示例7: CS_ASSERT

 //------------------------------------------------------------------------------ bool BinaryInputStream::Read(u8* buffer, u64 length) noexcept {     CS_ASSERT(IsValid(), "Trying to use an invalid FileStream.");          if(m_fileStream.eof())     {         return false;     }          //Ensure that we never overrun the file stream     const auto currentPosition = GetReadPosition();     const auto maxValidLength = std::min(m_length - currentPosition, length);          if(maxValidLength == 0)     {         return true;     }          m_fileStream.read(reinterpret_cast<s8*>(buffer), maxValidLength);          CS_ASSERT(!m_fileStream.fail(), "Unexpected error occured in filestream");          return true; }
开发者ID:AzCopey,项目名称:ChilliSource,代码行数:25,


示例8: ExpandIfNeeded

csStringBase &csStringBase::PadLeft (size_t iNewSize, char iChar){  if (iNewSize > Size)  {    ExpandIfNeeded (iNewSize);    char* p = GetDataMutable();          // GLOBAL NOTE *2*    CS_ASSERT(p != 0);    const size_t toInsert = iNewSize - Size;    memmove (p + toInsert, p, Size + 1); // GLOBAL NOTE *1*    for (size_t x = 0; x < toInsert; x++)      p [x] = iChar;    Size = iNewSize;  }  return *this;}
开发者ID:garinh,项目名称:cs,代码行数:15,


示例9: CS_ASSERT

 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ EntityUPtr PrimitiveEntityFactory::CreateBox(const Colour& in_colour, const Vector3& in_size) {     CS_ASSERT(Application::Get()->GetTaskScheduler()->IsMainThread(), "Entities must be created on the main thread.");          ModelCSPtr mesh = m_primitiveModelFactory->CreateBox(in_size);     MaterialCSPtr material = CreateStaticBlinnColourMaterial(in_colour);          StaticModelComponentSPtr meshComponent = m_renderComponentFactory->CreateStaticModelComponent(mesh, material);     meshComponent->SetShadowCastingEnabled(true);          auto entity = Entity::Create();     entity->SetName(ToString(m_entityCount++) + "-Box");     entity->AddComponent(meshComponent);     return entity; }
开发者ID:AzCopey,项目名称:ChilliSource,代码行数:17,


示例10: CS_ASSERT

//-------------------------------------------------------------//-------------------------------------------------------------void Entity::RemoveEntity(Entity* in_child){    CS_ASSERT(in_child != nullptr, "Cannot remove null child");    CS_ASSERT(in_child->GetParent() == this, "Cannot remove entity that is not a child of this");    SharedEntityList::iterator it = std::find_if(m_children.begin(), m_children.end(), [in_child](const EntitySPtr& in_entity)    {        return in_entity.get() == in_child;    });    if(it != m_children.end())    {        m_transform.RemoveChildTransform(&in_child->GetTransform());        if(m_scene != nullptr)        {            m_scene->Remove(in_child);        }        in_child->m_parent = nullptr;        std::swap(m_children.back(), *it);        m_children.pop_back();    }}
开发者ID:DNSMorgan,项目名称:ChilliSource,代码行数:26,


示例11: CS_ASSERT

		//------------------------------------------------		//------------------------------------------------		void PointerSystem::OnInit()		{			m_screen = ChilliSource::Application::Get()->GetSystem<ChilliSource::Screen>();			CS_ASSERT(m_screen != nullptr, "Cannot find system required by PointerSystem: Screen.");			m_mouseButtonConnection = SFMLWindow::Get()->GetMouseButtonEvent().OpenConnection(ChilliSource::MakeDelegate(this, &PointerSystem::OnMouseButtonEvent));			m_mouseMovedConnection = SFMLWindow::Get()->GetMouseMovedEvent().OpenConnection(ChilliSource::MakeDelegate(this, &PointerSystem::OnMouseMoved));			m_mouseWheelConnection = SFMLWindow::Get()->GetMouseWheelEvent().OpenConnection(ChilliSource::MakeDelegate(this, &PointerSystem::OnMouseWheeled));			//create the mouse pointer			ChilliSource::Integer2 mousePosi = SFMLWindow::Get()->GetMousePosition();			ChilliSource::Vector2 mousePos((f32)mousePosi.x, m_screen->GetResolution().y - (f32)mousePosi.y);			m_pointerId = AddPointerCreateEvent(mousePos);		}
开发者ID:angelahnicole,项目名称:ChilliSource_ParticleOpt,代码行数:17,


示例12: StreamingReporterBase

 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ CSReporter::CSReporter(const Catch::ReporterConfig& in_config) noexcept     : StreamingReporterBase(in_config) {     CS_ASSERT(!m_config->includeSuccessfulResults(), "CSReporter doesn't support reporting successful results.");     CS_ASSERT(!m_config->warnAboutMissingAssertions(), "CSReporter doesn't support warning about missing assertions.");     CS_ASSERT(!m_config->showInvisibles(), "CSReporter doesn't support showing invisibles.");     CS_ASSERT(!m_config->showDurations(), "CSReporter doesn't support showing durations.");     CS_ASSERT(!m_config->useColour(), "CSReporter doesn't support coloured output.");     CS_ASSERT(!m_config->shouldDebugBreak(), "CSReporter doesn't support debug break."); }
开发者ID:ChilliWorks,项目名称:CSTest,代码行数:12,


示例13: CS_ASSERT

psMovementManager::psMovementManager(iEventNameRegistry* eventname_reg, psControlManager* controls){    CS_ASSERT(eventname_reg);    event_frame = csevFrame(eventname_reg);    event_mousemove = csevMouseMove(eventname_reg,0);    actor = NULL;    this->controls = controls;    ready = false;    psengine->GetMsgHandler()->Subscribe(this,MSGTYPE_MOVEINFO);    psengine->GetMsgHandler()->Subscribe(this,MSGTYPE_MOVELOCK);    psengine->GetMsgHandler()->Subscribe(this,MSGTYPE_MOVEMOD);    defaultmode = NULL;    actormode = NULL;    onGround = true;    locked = false;    activeMoves = 0;    autoMove = false;    toggleRun = false;    mouseAutoMove = false;    mouseLook = false;    mouseLookCanAct = false;    mouseZoom = false;    mouseMove = false;    sneaking = false;    runToMarkerID = 0;    lastDist = 0.0f;    runToDiff = csVector3(0.0f);    lastDeltaX = 0.0f;    lastDeltaY = 0.0f;    sensY = 1.0f;    sensX = 1.0f;    invertedMouse = true;        activeModType = psMoveModMsg::NONE;    forward = NULL;    backward = NULL;    run = NULL;    walk = NULL;    kbdRotate = 0;}
开发者ID:Mixone-FinallyHere,项目名称:planeshift,代码行数:48,


示例14: GetData

// Note: isalpha(int c),  toupper(int c), tolower(int c), isspace(int c)// If c is not an unsigned char value, or EOF, the behaviour of these functions// is undefined.csStringBase &csStringBase::RTrim(){  if (Size > 0)  {    char const* const p = GetData();    CS_ASSERT(p != 0);    const char* c;    for (c = p + Size - 1; c != p; c--)      if (!isspace ((unsigned char)*c))        break;    size_t i = c - p;    if (i < Size - 1)      Truncate(i + 1);  }  return *this;}
开发者ID:garinh,项目名称:cs,代码行数:19,


示例15: CS_ASSERT

 //------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------ void ResourcePool::AddProvider(ResourceProvider* in_provider) {     CS_ASSERT(in_provider != nullptr, "Cannot add null resource provider to pool");     auto itDescriptor = m_descriptors.find(in_provider->GetResourceType());          if(itDescriptor == m_descriptors.end())     {         PoolDesc desc;         desc.m_providers.push_back(in_provider);         m_descriptors.insert(std::make_pair(in_provider->GetResourceType(), desc));     }     else     {         itDescriptor->second.m_providers.push_back(in_provider);     } }
开发者ID:angelahnicole,项目名称:ChilliSource_ParticleOpt,代码行数:18,


示例16: CreateSTDStringFromJString

			//------------------------------------------------------------------------------			//------------------------------------------------------------------------------			std::string CreateSTDStringFromJString(jstring in_jString)			{			    if (in_jString == nullptr)			    {			        return "";			    }				auto environment = JavaVirtualMachine::Get()->GetJNIEnvironment();                const char * cString = environment->GetStringUTFChars(in_jString, JNI_FALSE);                CS_ASSERT(cString != nullptr, "String returned from GetStringUTFChars() cannot be null.");                std::string output = std::string(cString);                environment->ReleaseStringUTFChars(in_jString, cString);                return output;			}
开发者ID:AzCopey,项目名称:ChilliSource,代码行数:18,


示例17: CS_ASSERT

        //-------------------------------------------------------        //-------------------------------------------------------		void TextEntry::Deactivate()		{            CS_ASSERT(ChilliSource::Application::Get()->GetTaskScheduler()->IsMainThread(), "Cannot deactivate system text entry outside of main thread.");			if (m_enabled == true)			{				m_textEntryJI->Deactivate();				m_enabled = false;				if(m_textInputDeactivatedDelegate != nullptr)				{					auto delegate = m_textInputDeactivatedDelegate;					m_textInputDeactivatedDelegate = nullptr;					delegate();				}			}		}
开发者ID:AzCopey,项目名称:ChilliSource,代码行数:18,


示例18: SetID

    bool dbRecord::Execute(uint32 uid)    {        SetID(uid);        CS_ASSERT_MSG("Error: wrong number of expected fields", index == count);        if(!prepared)            Prepare();        psStopWatch timer;        timer.Start();        CS_ASSERT(count != index);        csStringArray paramStrings;        const char *paramValues[index];        for(unsigned int i = 0; i < index; i++)        {            csString value;            switch(temp[i].type)            {                case SQL_TYPE_FLOAT:                    value.Format("%f", temp[i].fValue);                    break;                case SQL_TYPE_INT:                    value.Format("%i", temp[i].iValue);                    break;                case SQL_TYPE_STRING:                    value = temp[i].sValue;                    break;                case SQL_TYPE_NULL:                    break;            }            paramStrings.Push(value);            paramValues[i] = paramStrings.Get(i);        }        PGresult *res = PQexecPrepared(conn, stmt.GetData(), index, paramValues, NULL, NULL,0);        bool result = (res && PQresultStatus(res) != PGRES_FATAL_ERROR);        if(result && timer.Stop() > 1000)        {            csString status;            status.Format("SQL query in file %s line %d, has taken %u time to process./n", file, line, timer.Stop());            if(logcsv)                logcsv->Write(CSV_STATUS, status);        }        return result;    }
开发者ID:Mixone-FinallyHere,项目名称:planeshift,代码行数:47,


示例19: GetTargetType

bool Client::IsAllowedToAttack(gemObject * target, bool inform){    csString msg;    int type = GetTargetType(target);    if (type == TARGET_NONE)        msg = "You must select a target to attack.";    else if (type & TARGET_ITEM)        msg = "You can't attack an inanimate object.";    else if (type & TARGET_DEAD)        msg = "%s is already dead.";    else if (type & TARGET_FOE)    {        gemActor* foe = target->GetActorPtr();        gemActor* attacker = GetActor();        CS_ASSERT(foe != NULL); // Since this is a foe it should have a actor.        gemActor* lastAttacker = NULL;        if (target->HasKillStealProtection() && !foe->CanBeAttackedBy(attacker, &lastAttacker))        {            if (lastAttacker)            {                msg.Format("You must be grouped with %s to attack %s.",                           lastAttacker->GetName(), foe->GetName());            }            else            {                msg = "You are not allowed to attack right now.";            }        }    }    else if (type & TARGET_FRIEND)        msg = "You cannot attack %s.";    else if (type & TARGET_SELF)        msg = "You cannot attack yourself.";    if (!msg.IsEmpty())    {        if (inform)        {            psserver->SendSystemError(clientnum, msg, target? target->GetName(): "");        }        return false;    }    return true;}
开发者ID:garinh,项目名称:planeshift,代码行数:47,


示例20: CS_ASSERT

bool pawsShortcutWindow::OnFingering(csString string, psControl::Device device, uint button, uint32 mods){    pawsFingeringWindow* fingWnd = dynamic_cast<pawsFingeringWindow*>(PawsManager::GetSingleton().FindWidget("FingeringWindow"));    if (fingWnd == NULL || !fingWnd->IsVisible())        return true;    csString editedCmd;    editedCmd.Format("Shortcut %d",edit+1);    bool changed = false;    if (string == NO_BIND)  // Removing trigger    {        psengine->GetCharControl()->RemapTrigger(editedCmd,psControl::NONE,0,0);        changed = true;    }    else  // Changing trigger    {        changed = psengine->GetCharControl()->RemapTrigger(editedCmd,device,button,mods);    }    if (changed)    {        shortcutText->SetText(GetTriggerText(edit));        return true;  // Hide fingering window    }    else  // Map already exists    {        const psControl* other = psengine->GetCharControl()->GetMappedTrigger(device,button,mods);        CS_ASSERT(other);        csString name = GetDisplayName(other->name);        if (name.IsEmpty())     //then not cleaned up properly from deleting a shortcut        {            name = other->name; //use its numeric name        }        else        {            name.AppendFmt(" (%s)", other->name.GetDataSafe());        }        fingWnd->SetCollisionInfo(name);        return false;    }}
开发者ID:randomcoding,项目名称:PlaneShift-PSAI,代码行数:46,


示例21: CreateSTDStringFromJByteArray

			//------------------------------------------------------------------------------			//------------------------------------------------------------------------------			std::string CreateSTDStringFromJByteArray(jbyteArray in_array, u32 in_length)			{			    if (in_array == nullptr || in_length == 0)			    {			        return "";			    }				auto environment = JavaVirtualMachine::Get()->GetJNIEnvironment();                jbyte* bytes = environment->GetByteArrayElements(in_array, JNI_FALSE);                CS_ASSERT(bytes != nullptr, "Bytes returned by GetByteArrayElements() cannot be null.");                std::string strOutput((const char*)bytes, in_length);                environment->ReleaseByteArrayElements(in_array, bytes, 0);                return strOutput;			}
开发者ID:AzCopey,项目名称:ChilliSource,代码行数:19,


示例22: GetSector

void csMeshGenerator::SelfDestruct (){  if (GetSector ())  {    size_t c = GetSector ()->GetMeshGeneratorCount ();    while (c > 0)    {      c--;      if (GetSector ()->GetMeshGenerator (c) == (iMeshGenerator*)this)      {        GetSector ()->RemoveMeshGenerator (c);        return;      }    }    CS_ASSERT (false);  }}
开发者ID:Tank-D,项目名称:Shards,代码行数:17,


示例23: CS_ASSERT

 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ VListLayoutDef::VListLayoutDef(const Json::Value& in_json) {     const char k_typeKey[] = "Type";     const char k_numCellsKey[] = "NumCells";     const char k_relativeMarginsKey[] = "RelMargins";     const char k_absoluteMarginsKey[] = "AbsMargins";     const char k_relativeSpacingKey[] = "RelSpacing";     const char k_absoluteSpacingKey[] = "AbsSpacing";          for(auto it = in_json.begin(); it != in_json.end(); ++it)     {         CS_ASSERT((*it).isString() == true, "All properties in a Layout Description must be a string: " + std::string(it.memberName()));                  std::string key = it.memberName();         std::string value = (*it).asString();                  if (key == k_relativeMarginsKey)         {             m_relativeMargins = Core::ParseVector4(value);         }         else if (key == k_absoluteMarginsKey)         {             m_absoluteMargins = Core::ParseVector4(value);         }         else if (key == k_numCellsKey)         {             m_numCells = Core::ParseU32(value);         }         else if (key == k_relativeSpacingKey)         {             m_relativeSpacing = Core::ParseF32(value);         }         else if (key == k_absoluteSpacingKey)         {             m_absoluteSpacing = Core::ParseF32(value);         }         else if (key == k_typeKey)         {             //ignore         }         else         {             CS_LOG_FATAL("Invalid property found in a List layout description: " + key);         }     } }
开发者ID:DNSMorgan,项目名称:ChilliSource,代码行数:48,


示例24: CS_ASSERT

		//-------------------------------------------		//-------------------------------------------		void ParticleSystem::RemoveParticleComponent(ParticleComponent* in_particle)		{            CS_ASSERT(in_particle != nullptr, "Cannot remove null particle");                        u32 numParticles = m_particleComponents.size();            for(u32 i=0; i<numParticles; ++i)            {                if(m_particleComponents[i] == in_particle)                {                    //Swap and pop                    m_particleComponents[i]->SetOwningSystem(nullptr);                    m_particleComponents[i] = m_particleComponents.back();                    m_particleComponents.pop_back();                    return;                }            }		}
开发者ID:mclaughlinhugh4,项目名称:ChilliSource,代码行数:19,


示例25: CS_ASSERT

        //-----------------------------------------------------        void BackButtonSystem::OnDeviceButtonPressed(const CS::DeviceButtonSystem::DeviceButton& buttonPressed) noexcept        {            if (buttonPressed == CS::DeviceButtonSystem::DeviceButton::k_backButton)            {                auto stateManager = CS::Application::Get()->GetStateManager();                CS_ASSERT(stateManager, "No state manager active.");                if (stateManager->GetNumStates() > 1)                {                    stateManager->Pop();                }                else                {                    CS::Application::Get()->Quit();                }            }        }
开发者ID:ChilliWorks,项目名称:CSTest,代码行数:18,


示例26: GetNextAvailableUnit

 //------------------------------------------------------------------------------ GLuint GLTextureUnitManager::BindAdditional(const ChilliSource::RenderTexture* texture) noexcept {     GLuint textureIndex = GetNextAvailableUnit();          m_boundTextures.push_back(texture);          auto glTexture = static_cast<GLTexture*>(texture->GetExtraData());     CS_ASSERT(glTexture, "Cannot bind a texture which hasn't been loaded.");          glActiveTexture(GL_TEXTURE0 + textureIndex);     glBindTexture(GL_TEXTURE_2D, glTexture->GetHandle());     glActiveTexture(GL_TEXTURE0);          CS_ASSERT_NOGLERROR("An OpenGL error occurred while binding an additional texture.");          return textureIndex; }
开发者ID:AzCopey,项目名称:ChilliSource,代码行数:18,


示例27: ParseString

csRef<iDocument> ParseString(const csString & str, bool notify){    csRef<iDocumentSystem> xml;    xml.AttachNew(new csTinyDocumentSystem);    CS_ASSERT(xml != NULL);    csRef<iDocument> doc  = xml->CreateDocument();    const char* error = doc->Parse(str);    if (error)    {        if (notify)        {            Error3("Error in XML: %s/nString was: %s", error, str.GetDataSafe());        }        return NULL;    }    return doc;}
开发者ID:Chettie,项目名称:Eulora-client,代码行数:17,


示例28: ToCSV

 //---------------------------------------------------- //---------------------------------------------------- void ToCSV(const std::vector<std::string>& in_values, std::string& out_csv) {     if(in_values.empty())         return;          CS_ASSERT(in_values.size() < static_cast<std::size_t>(std::numeric_limits<u32>::max()), "Too many CSV items. It cannot exceed " + Core::ToString(std::numeric_limits<u32>::max()) + ".");          u32 numVals = static_cast<u32>(in_values.size()) - 1;     for(u32 i=0; i<numVals; ++i)     {         out_csv += in_values[i];         out_csv += ",";     }          //Add the last one without a following comma     out_csv += in_values[numVals]; }
开发者ID:DNSMorgan,项目名称:ChilliSource,代码行数:19,


示例29: strlen

csStringBase &csStringBase::Append (const char *iStr, size_t iCount){  /* Since "" is not the same as 0, make an empty string if a non-null      empty string is appended to a 0 string. */  if (iStr == 0 || ((iCount == 0) && (Size != 0)))    return *this;  if (iCount == (size_t)-1)    iCount = strlen (iStr);  size_t const NewSize = Size + iCount;  ExpandIfNeeded (NewSize);  char* p = GetDataMutable(); // GLOBAL NOTE *2*  CS_ASSERT(p != 0);  memcpy (p + Size, iStr, iCount);  Size = NewSize;  p [Size] = '/0';  return *this;}
开发者ID:garinh,项目名称:cs,代码行数:18,



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


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