Ejemplo n.º 1
0
DnsResource* DnsLayer::getAdditionalRecord(const std::string& name, bool exactMatch)
{
	uint16_t numOfAdditionalRecords = ntohs(getDnsHeader()->numberOfAdditional);
	IDnsResource* res = getResourceByName(m_FirstAdditional, numOfAdditionalRecords, name, exactMatch);
	if (res != NULL)
		return dynamic_cast<DnsResource*>(res);
	return NULL;
}
Ejemplo n.º 2
0
DnsQuery* DnsLayer::getQuery(const std::string& name, bool exactMatch)
{
	uint16_t numOfQueries = ntohs(getDnsHeader()->numberOfQuestions);
	IDnsResource* res = getResourceByName(m_FirstQuery, numOfQueries, name, exactMatch);
	if (res != NULL)
		return dynamic_cast<DnsQuery*>(res);
	return NULL;
}
Ejemplo n.º 3
0
	//-----------------------------------------------------------------------
	void ResourceManager::remove(const String& name)
	{
		ResourcePtr res = getResourceByName(name);

		if (!res.isNull())
		{
			removeImpl(res);
		}
	}
Ejemplo n.º 4
0
CLuaScriptPtr CLuaScriptManager::load(const Ogre::String &name, const Ogre::String &group)
{
   CLuaScriptPtr ptr = getResourceByName(name, group).dynamicCast<CLuaScript>();

   if (ptr.isNull())
       ptr = createResource(name, group).dynamicCast<CLuaScript>();

   ptr->load();
   return ptr;
}
Ejemplo n.º 5
0
	//-----------------------------------------------------------------------
	void ResourceManager::unload(const String& name)
	{
		ResourcePtr res = getResourceByName(name);

		if (!res.isNull())
		{
			// Unload resource
			res->unload();

		}
	}
Ejemplo n.º 6
0
    //-----------------------------------------------------------------------
    void ResourceManager::remove(const String& name, const String& group)
    {
        ResourcePtr res = getResourceByName(name, group);

#if OGRE_RESOURCEMANAGER_STRICT
        OgreAssert(res, ("attempting to remove unknown resource: "+name+" in group "+group).c_str());
#endif

        if (res)
        {
            removeImpl(res);
        }
    }
Ejemplo n.º 7
0
    //-----------------------------------------------------------------------
    ResourceManager::ResourceCreateOrRetrieveResult 
    ResourceManager::createOrRetrieve(
        const String& name, const String& group, 
        bool isManual, ManualResourceLoader* loader, 
        const NameValuePairList* params)
    {
        // Lock for the whole get / insert
            OGRE_LOCK_AUTO_MUTEX;

        ResourcePtr res = getResourceByName(name, group);
        bool created = false;
        if (!res)
        {
            created = true;
            res = createResource(name, group, isManual, loader, params);
        }

        return ResourceCreateOrRetrieveResult(res, created);
    }
Ejemplo n.º 8
0
//-----------------------------------------------------------------------
CompositorPtr CompositorManager::getByName(const String& name, const String& groupName)
{
    return getResourceByName(name, groupName).staticCast<Compositor>();
}
Ejemplo n.º 9
0
 //-----------------------------------------------------------------------
 GpuProgramPtr GpuProgramManager::getByName(const String& name, const String& group, bool preferHighLevelPrograms)
 {
     return getResourceByName(name, group, preferHighLevelPrograms).staticCast<GpuProgram>();
 }
Ejemplo n.º 10
0
 //-----------------------------------------------------------------------
 FontPtr FontManager::getByName(const String& name, const String& groupName)
 {
     return getResourceByName(name, groupName).staticCast<Font>();
 }
Ejemplo n.º 11
0
 //-----------------------------------------------------------------------
 MeshPtr MeshManager::getByName(const String& name, const String& groupName)
 {
     return getResourceByName(name, groupName).staticCast<Mesh>();
 }
 //-----------------------------------------------------------------------
 MaterialPtr MaterialManager::getByName(const String& name, const String& groupName)
 {
     return getResourceByName(name, groupName).staticCast<Material>();
 }
Ejemplo n.º 13
0
 //-----------------------------------------------------------------------
 SkeletonPtr SkeletonManager::getByName(const String& name, const String& groupName)
 {
     return getResourceByName(name, groupName).staticCast<Skeleton>();
 }