Ejemplo n.º 1
0
void SSL_HandShakeMessage::PerformActionL(DataStream::DatastreamAction action, uint32 arg1, uint32 arg2)
{
	switch(action)
	{
	case DataStream::KReadAction:
	case DataStream::KWriteAction:
		{
			uint32 step = arg1;
			int record_item_id = (int) arg2;

			if(record_item_id == DataStream_SequenceBase::STRUCTURE_START)
			{
				if(action == DataStream::KWriteAction)
					spec.enable_length = (connstate->version.Major() >= 3);
				else
					length.SetEnableRecord(connstate->version.Major() >= 3);
				dummy.ResetRecord();
				dummy.SetEnableRecord(TRUE);
			}
			
			LoadAndWritableList::PerformActionL(action, step, record_item_id);
			
			if(action == DataStream::KReadAction)
			{
				if(record_item_id == RECORD_TAG)
				{
					if(connstate->version.Major() < 3)
						SetTag((SSL_HandShakeType)(((uint32) GetTag()) | 0x100)); // Convert 8 bit value into the SSL v2 message type
					
					LEAVE_IF_ERROR(SetMessage((SSL_HandShakeType) GetTag()));
				}
				else if(record_item_id == STRUCTURE_FINISHED)
				{
					if(dummy.GetLength() != 0 && GetTag() != SSL_Client_Hello)
						RaiseAlert(SSL_Fatal,SSL_Illegal_Parameter);
				}
			}
		}
		break;
	default: 
		LoadAndWritableList::PerformActionL(action, arg1, arg2);
	}
}
Ejemplo n.º 2
0
bool HouseKeeperTask::CheckRun(QDateTime now)
{
    LOG(VB_GENERAL, LOG_DEBUG, QString("Checking to run %1").arg(GetTag()));
    bool check = false;
    if (!m_confirm && (check = DoCheckRun(now)))
        // if m_confirm is already set, the task is already in the queue
        // and should not be queued a second time
        m_confirm = true;
    return check;
}
Ejemplo n.º 3
0
Archivo: jcall.cpp Proyecto: skopp/rush
void JCall::OnPlay()
{
    if (!m_pObject)
    {
        Init();
    }
    if (m_pObject)
    {
        m_pObject->CallMethod( m_Method.c_str(), GetTag() );
    }
} // JCall::OnPlay
Ejemplo n.º 4
0
FString FXmlNode::GetAttribute(const FString& InTag) const
{
	for(auto Iter(Attributes.CreateConstIterator()); Iter; Iter++)
	{
		if(Iter->GetTag() == InTag)
		{
			return Iter->GetValue();
		}
	}
	return FString();
}
Ejemplo n.º 5
0
result_t CYamlScalar::SaveToFile ( yaml_emitter_t* _pEmitter ) const
{
    result_t result_t = eResult_OK;

    yaml_event_t event;

    yaml_scalar_event_initialize ( &event, (yaml_char_t*)GetAnchor(), (yaml_char_t*)GetTag(), (yaml_char_t*)GetValue(), int(m_Value.Size()), 1, 0, CYamlScalar::ToYamlStyle(m_Style) );
    ex_check_return ( Flush( _pEmitter, &event ), "Flush failed" );

    return eResult;
}
Ejemplo n.º 6
0
int mainprog(void)
{
	int res=0;
	/* Initialisation des listes */
	InitChListe(&PLCs);

	res=OpenDb(DBHOST,USER,PASS,DB);
	if (res<0) {Log(LOG_CRIT,"OpenDb (%d) : %s\n",res,MysqlErrorMsg);return(res);}
	else
	{
		Plc_count=GetPlcList(NULL,&CONTROLLERs);
		if (Plc_count<0) Log(LOG_CRIT,"Get Plc count error (%d) : %s\n",Plc_count,MysqlErrorMsg);
			else
			{
				if (Plc_count==0) Log(LOG_NOTICE,"There is no Plcs\n");
					else Log(LOG_NOTICE,"There is : %d Plcs\n",Plc_count);
			}
		Tag_count=GetCount("select * from DEFINITION");
		if (Tag_count<0) Log(LOG_CRIT,"Get Tag count error (%d) : %s\n",Tag_count,MysqlErrorMsg);
			else
			{
				if (Tag_count==0) Log(LOG_NOTICE,"There is no Tags\n");
					else Log(LOG_NOTICE,"There is : %d Tags\n",Tag_count);
			}
		if ((Plc_count>0)&&(Tag_count>0))
		{
			Tag_count=0;
			Plc_count=GetPlcList(&PLCs,&CONTROLLERs);
			if (PLCs.Count>0)
			{
				Log(LOG_NOTICE,"There is %d PLC to create\n",PLCs.Count);
				ELEMENT *elt=GetFirst(&PLCs);
				while (elt!=NULL)
				{
					PLC *plc=elt->Data;
					res=GetTag(plc);
					if (res>0) Tag_count+=res;
					else
						{
							if (res==0) Log(LOG_NOTICE,"(%s) there is no Tag for PLC : %s\n",MysqlErrorMsg,plc->PlcName);
								else Log(LOG_CRIT,"Get Tag error (%d) : %s for PLC : %s\n",res,MysqlErrorMsg,plc->PlcName);
						}
					Optimise(plc);
					elt=GetNext(&PLCs,elt);
				}
			} else Log(LOG_CRIT,"Get Plc error (%d) : %s\n",res,MysqlErrorMsg);
			// Appel Logger
			if (Tag_count>0) res=Logger(&PLCs);
		} else Log(LOG_WARNING,"There is nothing to do. exiting...\n");
		CloseDb;
	}
	return(res);
}
Ejemplo n.º 7
0
void JAnmSound::ResInit()
{
    if (!g_pSoundServer)
    {
        return;
    }
    m_SoundID = g_pSoundServer->GetSoundID( m_File.c_str(), GetTag() );
    if (GetDuration() == 0.0f)
    {
        SetDuration( g_pSoundServer->GetTotalTime( m_SoundID ) );
    }
} // JAnmSound::OnStop
Ejemplo n.º 8
0
const std::string MaybeType::GetValueSeparator(const Indent& indent,
		const void* value) const {
	ostringstream buffer;
	auto sum_instance = static_cast<const Sum*>(value);

	auto tag = sum_instance->GetTag();
	if (*tag == *MaybeTypeSpecifier::VARIANT_NAME) {
		buffer << "\n" << indent + 1;
	} else if (*tag == *TypeTable::GetNilName()) {
		buffer << " ";
	}
	return buffer.str();
}
Ejemplo n.º 9
0
Boolean IccServiceTable::IsAvailable(
    /* [in] */ Int32 service)
{
    Int32 offset = service / 8;
    if (offset >= mServiceTable->GetLength()) {
        // Note: Enums are zero-based, but the TS service numbering is one-based
        Logger::E(GetTag(), String("isAvailable for service ") + StringUtils::ToString(service + 1)
                + String(" fails, max service is ")
                + StringUtils::ToString(mServiceTable->GetLength() * 8));
        return FALSE;
    }
    Int32 bit = service % 8;
    return ((*mServiceTable)[offset] & (1 << bit)) != 0;
}
Ejemplo n.º 10
0
    void serialize(PyrSlot * slot)
    {
        if (IsFloat(slot)) {
            emitter << slotRawFloat(slot);
            return;
        }

        switch (GetTag(slot)) {
        case tagNil:
            emitter << YAML::Null;
            return;

        case tagInt:
            emitter << slotRawInt(slot);
            return;

        case tagFalse:
            emitter << false;
            return;

        case tagTrue:
            emitter << true;
            return;

        case tagObj:
            serialize(slotRawObject(slot));
            return;

        case tagSym:
            emitter << YAML::DoubleQuoted << slotRawSymbol(slot)->name;
            return;

        default:
            printf ("type: %d\n", GetTag(slot));
            throw std::runtime_error("YAMLSerializer: not implementation for this type");
        }
    }
Ejemplo n.º 11
0
bool CRoomTemplate::SaveRoomTemplate()
{
    if (!m_pLevelTheme)
        return false;

    char szThemeDirName[MAX_PATH];
    Q_snprintf(szThemeDirName, sizeof(szThemeDirName), "tilegen/roomtemplates/%s", m_pLevelTheme->m_szName);
    g_pFullFileSystem->CreateDirHierarchy( szThemeDirName, "GAME" );

    char szFullFileName[MAX_PATH];
    Q_snprintf( szFullFileName, sizeof(szFullFileName), "tilegen/roomtemplates/%s/%s.roomtemplate", m_pLevelTheme->m_szName, m_FullName );
    KeyValues *pRoomTemplateKeyValues = new KeyValues( m_FullName );
    pRoomTemplateKeyValues->SetInt( "TilesX", m_nTilesX );
    pRoomTemplateKeyValues->SetInt( "TilesY", m_nTilesY );
    pRoomTemplateKeyValues->SetInt( "SpawnWeight", m_nSpawnWeight );
    pRoomTemplateKeyValues->SetString( "RoomTemplateDescription", m_Description );
    pRoomTemplateKeyValues->SetString( "Soundscape", m_Soundscape );
    pRoomTemplateKeyValues->SetInt( "TileType", m_nTileType );

    // exits
    int iExits = m_Exits.Count();
    for (int i=0; i<iExits; i++)
    {
        KeyValues *pkvSubSection = new KeyValues("EXIT");
        pkvSubSection->SetInt("XPos", m_Exits[i]->m_iXPos);
        pkvSubSection->SetInt("YPos", m_Exits[i]->m_iYPos);
        pkvSubSection->SetInt("ExitDirection", (int) m_Exits[i]->m_ExitDirection);
        pkvSubSection->SetInt("ZChange", m_Exits[i]->m_iZChange);
        pkvSubSection->SetString("ExitTag", m_Exits[i]->m_szExitTag);
        pkvSubSection->SetBool("ChokeGrow", m_Exits[i]->m_bChokepointGrowSource);

        pRoomTemplateKeyValues->AddSubKey(pkvSubSection);
    }

    // tags
    KeyValues *pkvSubSection = new KeyValues("Tags");
    for ( int i=0; i<GetNumTags(); i++ )
    {
        pkvSubSection->AddSubKey( new KeyValues( "tag", NULL, GetTag( i ) ) );
    }
    pRoomTemplateKeyValues->AddSubKey(pkvSubSection);

    if (!pRoomTemplateKeyValues->SaveToFile(g_pFullFileSystem, szFullFileName, "GAME"))
    {
        Msg("Error: Failed to save room template %s\n", szFullFileName);
        return false;
    }
    return true;
}
Ejemplo n.º 12
0
size_t psXMLString::GetWithinTagSection(int start, const char* tagName, 
                                     psXMLString& tagSection)
{
    size_t end = FindMatchingEndTag( start, tagName );

    if ( end == (size_t)-1 )
        tagSection = psString("");
    else
    {
        psXMLTag startTag;
        GetTag(start, startTag);
        start+=(int)startTag.Length();
        GetSubString(tagSection, start, end);
    }
    return tagSection.Length();
}
Ejemplo n.º 13
0
void GraphBase::BaseStore(wxString path, wxString tag)
{
	int i;
	TextFile outfile;
	wxString text, filename, filetag;

	filename = "gbase-" + tag + ".dat";

	//outfile.New(initpath + "/Graphs/" + filename);
	outfile.New(path + "/" + filename);
	for(i=0; i<numgraphs; i++) {
		outfile.WriteLine(graphstore[i].StoreDat(GetTag(i)));
		//outfile.WriteLine(text.Format
	}
	outfile.Close();
}
Ejemplo n.º 14
0
RenderString::RenderString(ResourcePtr<FontBase> font, const unsigned int& size, const std::u16string& text) :
		mFont(font), mSize(size), mAppendString(text) {
	
	if (mFont) { // if we have a valid font...
		mRBDData.mTextureID = mFont->GetTextureID(); // update the texture id of the batch data
		
		float fontSize = static_cast<float>(mFont->GetFontSize()); // get the size of the font
		mTextScale = glm::vec2(mSize / fontSize, mSize / fontSize); // calculate the scale factor for the render string
		
		mFontType = mFont->GetType();
	}
	
	UpdateRenderString(); // ensure all characters are ready to be rendered
	
	mRBDData.mTag = GetTag(); // update the tag of the batch data
}
Ejemplo n.º 15
0
CCollectionFile::CCollectionFile(CFileDataIO* in_data)
{
	UINT tagcount = in_data->ReadUInt32();

	for (UINT i = 0; i < tagcount; i++)
	{
		CTag* toadd = new CTag(in_data, true);
		if (toadd)
			taglist.Add(toadd);
	}
	
	CTag* pTagHash = GetTag(FT_FILEHASH);
	if(pTagHash)
		SetFileHash(pTagHash->GetHash());
	else
		ASSERT(0);
	
	// here we have two choices
	//	- if the server/client sent us a filetype, we could use it (though it could be wrong)
	//	- we always trust our filetype list and determine the filetype by the extension of the file
	//
	// if we received a filetype from server, we use it.
	// if we did not receive a filetype, we determine it by examining the file's extension.
	//
	// but, in no case, we will use the receive file type when adding this search result to the download queue, to avoid
	// that we are using 'wrong' file types in part files. (this has to be handled when creating the part files)
	const CString& rstrFileType = GetStrTagValue(FT_FILETYPE);
	SetFileName(GetStrTagValue(FT_FILENAME), false, rstrFileType.IsEmpty());
	SetFileSize(GetIntTagValue(FT_FILESIZE));
	if (!rstrFileType.IsEmpty())
	{
		if (_tcscmp(rstrFileType, _T(ED2KFTSTR_PROGRAM))==0)
		{
			CString strDetailFileType = GetFileTypeByName(GetFileName());
			if (!strDetailFileType.IsEmpty())
				SetFileType(strDetailFileType);
			else
				SetFileType(rstrFileType);
		}
		else
			SetFileType(rstrFileType);
	}

	if(!GetFileSize() || !GetFileName().Compare(_T("")))
		ASSERT(0);
}
Ejemplo n.º 16
0
inline int prOpFloat(VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a, *b;
	PyrSymbol *msg;

	a = g->sp - 1;
	b = g->sp;

	switch (GetTag(b)) {
		case tagInt :
			SetRaw(a, Functor::run(slotRawFloat(a), (double)slotRawInt(b)));
			break;
		case tagChar :
		case tagPtr :
		case tagNil :
		case tagFalse :
		case tagTrue :
			goto send_normal_2;
		case tagSym :
			SetSymbol(a, slotRawSymbol(b));
			break;
		case tagObj :
			if (isKindOf(slotRawObject(b), class_signal))
				SetObject(a, Functor::signal_fx(g, slotRawFloat(a), slotRawObject(b)));
			else
				goto send_normal_2;
			break;
		default :
			SetRaw(a, Functor::run(slotRawFloat(a), slotRawFloat(b)));
			break;
	}
	g->sp-- ; // drop
	g->numpop = 0;
#if TAILCALLOPTIMIZE
	g->tailCall = 0;
#endif
	return errNone;

	send_normal_2:
	if (numArgsPushed != -1)  // special case flag meaning it is a primitive
		return errFailed;	// arguments remain on the stack

	msg = gSpecialBinarySelectors[g->primitiveIndex];
	sendMessage(g, msg, 2);
	return errNone;
}
Ejemplo n.º 17
0
void JSlidePiece::OnMouse( JMouseEvent& e )
{
    if (e.MouseKey() == mkLeft && e.Action() == aKeyDown && 
        IsVisible())
    {
        if (GetTag() == m_pSlideGame->GetCatchID())
        {
            m_pSlideGame->OnTakeRight();
        } 
        else
        {
            m_pSlideGame->OnTakeWrong();
        }
        SetVisible( false );
        StartFalling();
        e.Consume();
    }
} // JSlidePiece::OnMouse
Ejemplo n.º 18
0
void DailyHouseKeeperTask::CalculateWindow(void)
{
    PeriodicHouseKeeperTask::CalculateWindow();
    QDate date = GetLastRun().addDays(1).date();

    QDateTime tmp = QDateTime(date, QTime(m_windowHour.first, 0));
    if (GetLastRun().addSecs(m_windowElapsed.first) < tmp)
        m_windowElapsed.first = GetLastRun().secsTo(tmp);

    tmp = QDateTime(date, QTime(m_windowHour.second, 30));
    // we want to make sure this gets run before the end of the day
    // so add a 30 minute buffer prior to the end of the window
    if (GetLastRun().addSecs(m_windowElapsed.second) > tmp)
        m_windowElapsed.second = GetLastRun().secsTo(tmp);

    LOG(VB_GENERAL, LOG_DEBUG, QString("%1 Run window between %2 - %3.")
        .arg(GetTag()).arg(m_windowElapsed.first).arg(m_windowElapsed.second));
}
Ejemplo n.º 19
0
void main()
{
	//Goes in OnItemActivate in module properties
    object oUsed = GetItemActivated();

    if(GetTag(oUsed)=="Intontimento")
    {
        object oPC = GetItemActivator();
        object oShadow = GetObjectByTag("Shadow");
        effect eParalyze = EffectCutsceneImmobilize();
        effect eVisualParalyze = EffectVisualEffect(VFX_FNF_SOUND_BURST_SILENT);

        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eParalyze, oShadow, 10.0f);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVisualParalyze, oShadow, 5.0f);



    }
}
Ejemplo n.º 20
0
static int addMsgSlot(big_scpacket *packet, PyrSlot *slot)
{
	switch (GetTag(slot)) {
		case tagInt :
			packet->addi(slotRawInt(slot));
			break;
		case tagSym :
			packet->adds(slotRawSymbol(slot)->name);
			break;
		case tagObj :
			if (isKindOf(slotRawObject(slot), class_string)) {
				PyrString *stringObj = slotRawString(slot);
				packet->adds(stringObj->s, stringObj->size);
			} else if (isKindOf(slotRawObject(slot), class_int8array)) {
				PyrInt8Array *arrayObj = slotRawInt8Array(slot);
				packet->addb(arrayObj->b, arrayObj->size);
			} else if (isKindOf(slotRawObject(slot), class_array)) {
				PyrObject *arrayObj = slotRawObject(slot);
				big_scpacket packet2;
				if (arrayObj->size > 1 && isKindOfSlot(arrayObj->slots+1, class_array)) {
					makeSynthBundle(&packet2, arrayObj->slots, arrayObj->size, true);
				} else {
					int error = makeSynthMsgWithTags(&packet2, arrayObj->slots, arrayObj->size);
					if (error != errNone)
						return error;
				}
				packet->addb((uint8*)packet2.data(), packet2.size());
			}
			break;
		case tagNil :
		case tagTrue :
		case tagFalse :
		case tagChar :
		case tagPtr :
			break;
		default :
			if (gUseDoubles) packet->addd(slotRawFloat(slot));
			else packet->addf(slotRawFloat(slot));
			break;
	}
	return errNone;
}
Ejemplo n.º 21
0
bool PyrGC::SanityMarkObj(PyrObject *objA, PyrObject *fromObj, int level)
{
	if (objA->IsPermanent()) return true;
	if (objA->IsMarked()) return true;
	if (objA->size > MAXINDEXSIZE(objA)) {
		fprintf(stderr, "obj indexed size larger than max: %d > %ld\n", objA->size, MAXINDEXSIZE(objA));
		//dumpObject((PyrObject*)objA);
		return false;
	}

	objA->SetMark(); // mark it
	if (!BlackToWhiteCheck(objA))
		return false;

	if (objA->obj_format <= obj_slot) {
		// scan it
		int size = objA->size;
		if (size > 0) {
			PyrSlot *slot = objA->slots;
			for (int j=size; j--; ++slot) {
				PyrObject * objB = NULL;
				int tag = GetTag(slot);
				if (tag == tagObj && slotRawObject(slot))
					objB = slotRawObject(slot);

				if (objB) {
					/*
					if (level > 40) {
						fprintf(stderr, "40 levels deep!\n");
						dumpBadObject(objA);
						dumpBadObject(objB);
						return false;
					} */
					bool err = SanityMarkObj(objB, objA, level + 1);
					if (!err)
						return false;
				}
			}
		}
	}
	return true;
}
Ejemplo n.º 22
0
const std::string MaybeType::ValueToString(const TypeTable& type_table,
		const Indent& indent, const_shared_ptr<void> value) const {
	ostringstream buffer;
	auto sum_instance = static_pointer_cast<const Sum>(value);
	auto tag = sum_instance->GetTag();
	buffer << "{" << *tag << "}";
	if (*tag == *TypeTable::GetNilName()) {
	} else if (*tag == *MaybeTypeSpecifier::VARIANT_NAME) {
		auto type_result = m_base_type_specifier->GetType(type_table, RESOLVE);
		if (ErrorList::IsTerminator(type_result->GetErrors())) {
			auto type = type_result->GetData<TypeDefinition>();
			auto inner_value = sum_instance->GetValue();
			buffer << type->GetValueSeparator(indent, inner_value.get());
			buffer << type->ValueToString(type_table, indent + 1, inner_value);
		} else {
			buffer << "<undefined type>";
		}
	} else {
		buffer << "<undefined variant>";
	}
	return buffer.str();
}
//retrieve string (pattern) by number
//called by Parse when '\0'-'\9' found
BOOL COXRegExpression::GetPattern(int nNumber, CString &sPattern)
{
	
	if (nNumber<0 ||nNumber>9)
		return FALSE;
	int nIndex=0;
	for (int n=0;n<GetTagCount();n++)
	{
		tRegExpTag* pTag=GetTag(n);
		if (pTag->nType==OX_REGEXP_TAG_PATTERN)
		{
			if (nIndex==nNumber)
			{
				sPattern=pTag->sValue;
				return TRUE;
			}
			else
				nIndex++;

		}
	}
	return FALSE;
}
Ejemplo n.º 24
0
// ==============================  INPUT HANDLING  ========================================
long TpartEditForm::DoControlClick( long arg, void *ptr )
{
#ifdef __MWERKS__
	#pragma unused(ptr)
#endif
	tag_entry* e;
	tag new_id;
	
	switch( arg )
	{
		case 11801:	// Choose a tag
			new_id = pick_tag_of_type('spri', GetTag( 11801 ), fEntry );
			if(new_id != 0) SetTag( 11801, 'spri', new_id );
		break; 
		
		case 11802:	// Open tag window
			e = get_entry('spri', GetTag( 11801 ) );
			if(e) TRevengeApp::OpenItem( e );
		break;
		
		case 11805:	// Choose a tag
			new_id = pick_tag_of_type('amso', GetTag( 11805 ), fEntry );
			if(new_id != 0) SetTag( 11805, 'amso', new_id );
		break; 
		
		case 11806:	// Open tag window
			e = get_entry('amso', GetTag( 11805 ) );
			if(e) TRevengeApp::OpenItem( e );
		break;
		
		case 11807:	// Choose a tag
			new_id = pick_tag_of_type('lpgr', GetTag( 11807 ), fEntry );
			if(new_id != 0) SetTag( 11807, 'lpgr', new_id );
		break; 
		
		case 11808:	// Open tag window
			e = get_entry('lpgr', GetTag( 11807 ) );
			if(e) TRevengeApp::OpenItem( e );
		break;
		
		default:
			return -1;
	}
	return 0;
}
Ejemplo n.º 25
0
ECode IccServiceTable::ToString(
    /* [out] */ String* result)
{
    VALIDATE_NOT_NULL(result);
    AutoPtr<ArrayOf<IInterface*> > values = GetValues();
    Int32 numBytes = mServiceTable->GetLength();
    StringBuilder builder(GetTag());
    builder.Append('[');
    builder.Append(numBytes * 8);
    builder.Append(String("]={ "));

    Boolean addComma = FALSE;
    for (Int32 i = 0; i < numBytes; i++) {
        Byte currentByte = (*mServiceTable)[i];
        for (Int32 bit = 0; bit < 8; bit++) {
            if ((currentByte & (1 << bit)) != 0) {
                if (addComma) {
                    builder.Append(", ");
                }
                else {
                    addComma = TRUE;
                }
                Int32 ordinal = (i * 8) + bit;
                if (ordinal < values->GetLength()) {
                    builder.Append((*values)[ordinal]);
                }
                else {
                    builder.Append('#');
                    builder.Append(ordinal + 1);    // service number (one-based)
                }
            }
        }
    }
    builder.Append(" }");
    builder.ToString(result);
    return NOERROR;
}
Ejemplo n.º 26
0
 inline
 void Vector::Copy(const Vector& x)
 {
   CopyImpl(x);
   ObjectChanged();
   // Also copy any cached scalar values from the original vector
   // ToDo: Check if that is too much overhead
   TaggedObject::Tag x_tag = x.GetTag();
   if (x_tag == x.nrm2_cache_tag_) {
     nrm2_cache_tag_ = GetTag();
     cached_nrm2_ = x.cached_nrm2_;
   }
   if (x_tag == x.asum_cache_tag_) {
     asum_cache_tag_ = GetTag();
     cached_asum_ = x.cached_asum_;
   }
   if (x_tag == x.amax_cache_tag_) {
     amax_cache_tag_ = GetTag();
     cached_amax_ = x.cached_amax_;
   }
   if (x_tag == x.max_cache_tag_) {
     max_cache_tag_ = GetTag();
     cached_max_ = x.cached_max_;
   }
   if (x_tag == x.min_cache_tag_) {
     min_cache_tag_ = GetTag();
     cached_min_ = x.cached_min_;
   }
   if (x_tag == x.sum_cache_tag_) {
     sum_cache_tag_ = GetTag();
     cached_sum_ = x.cached_sum_;
   }
   if (x_tag == x.sumlogs_cache_tag_) {
     sumlogs_cache_tag_ = GetTag();
     cached_sumlogs_ = x.cached_sumlogs_;
   }
 }
Ejemplo n.º 27
0
HRESULT KG3DAnimationTagContainer::Start(float fSpeed, 
										 int   nOffsetTime, 
										 DWORD dwType, 
										 enuAnimationControllerPriority Priority)
{
    HRESULT hr = E_FAIL;
    HRESULT hRetCode = E_FAIL;
    IKG3DAnimationController* pController = NULL;

    KG_PROCESS_ERROR(m_pModel);
    KG_PROCESS_ERROR(m_szAnimationName[0] != '\0');

	if(!m_pClip)
	{
		hr = g_cClipTable.LoadResourceFromFile(m_szAnimationName, 0, 0, &m_pClip);
		KG_COM_PROCESS_ERROR(hr);
	}
    switch(dwType)
    {
    case ENU_ANIMATIONPLAY_ADDCURRENT_ONCE:
    case ENU_ANIMATIONPLAY_ADDCURRENT:
        {
            KG3DAnimationMotionTag* pMotionTag = dynamic_cast<KG3DAnimationMotionTag*>(GetTag(TAGTYPE_MOTION));
            if (pMotionTag)
            {
                UINT uStartFrame = pMotionTag->GetMotionStart();
                nOffsetTime = m_pClip->ConvertFrameToTime(uStartFrame);
            }
        }
        break;
    }
    hr = m_pModel->Helper_PlayAnimationNormal(dwType, 
		m_szAnimationName, 
		fSpeed, 
        nOffsetTime, 
		NULL, 
		Priority,
		MPAT_TAGGED,
		this,m_pClip);
    KGLOG_COM_PROCESS_ERROR(hr);

    pController = m_pModel->GetAnimationController(Priority);
    KG_PROCESS_ERROR(pController);

    pController->AddAnimationControllerUpdateNotifier(this);
    for (size_t i = 0; i < m_vecTags.size(); i++)
    {
        IKG3DAnimationTag* pTag = m_vecTags[i].pTag;
        if (pTag)
        {
            pTag->SetAnimationSpeed(fSpeed);
            pTag->Reset();
        }
    }
    hRetCode = S_OK;
Exit0:
    return hRetCode;
}
Ejemplo n.º 28
0
char GetChar(int source) {
  CheckNodeId(source);
  GetTag(source, kChar);
  return GetRawByte(&incoming_buffers[source]);
}
Ejemplo n.º 29
0
SSL_ContentType SSL_Record_Base::GetType() const
{
	return (SSL_ContentType) GetTag();
}
Ejemplo n.º 30
0
OP_STATUS SSL_HandShakeMessage::SetMessage( SSL_HandShakeType item)
{
	if ((SSL_HandShakeType) GetTag() != item || msg == NULL)
	{
		LoadAndWritableList *temp;
		if(msg != NULL)
		{
			temp = msg;
			msg = NULL;
			ServerKeys = NULL;
			OP_DELETE(temp);
		}

		temp = NULL;

		switch (item)
		{
		case SSL_Client_Hello  : 
			temp = OP_NEW(SSL_Client_Hello_st, ());
			break;
		case SSL_Server_Hello  :
			temp = OP_NEW(SSL_Server_Hello_st, ());
			break;
		case SSL_Certificate :   
			temp = OP_NEW(SSL_Certificate_st, ());
			break;
		case SSL_Server_Key_Exchange  : 
			temp = ServerKeys = OP_NEW(SSL_Server_Key_Exchange_st, ());
			break;
		case SSL_CertificateRequest  : 
			temp = CertRequest = OP_NEW(SSL_CertificateRequest_st, ());
			break;
		case SSL_Certificate_Verify   : 
			temp = OP_NEW(SSL_CertificateVerify_st, ());
			break;  
		case SSL_Client_Key_Exchange  : 
			temp = OP_NEW(SSL_Client_Key_Exchange_st, ());
			break;
		case SSL_Finished :      
			temp = OP_NEW(SSL_Finished_st, ());
			break;
		case SSL_Server_Hello_Done :      
			temp = OP_NEW(SSL_Hello_Done_st, ());
			break;
		case TLS_NextProtocol :
			temp = OP_NEW(SSL_NextProtocol_st, ());
			break;

#ifndef TLS_NO_CERTSTATUS_EXTENSION
		case TLS_CertificateStatus:
			temp = OP_NEW(TLS_CertificateStatusResponse, ());
			break;
#endif
        default : break;
		} 
		msg = temp;
		if(msg == NULL && (item != SSL_NONE && item != SSL_Server_Hello_Done  && 
			item != SSL_Hello_Request))
		{
			RaiseAlert(SSL_Internal, SSL_Allocation_Failure);
			return OpStatus::ERR_NO_MEMORY;
		} 

		SetTag(item);
		if(connstate != NULL)
		{
			if(item == SSL_Server_Key_Exchange)
				ServerKeys->SetCommState(connstate);
			else if(item == SSL_CertificateRequest)
				CertRequest->SetCommState(connstate);
		}


		dummy.ResetRecord();
	}