本文整理汇总了C++中SetVariable函数的典型用法代码示例。如果您正苦于以下问题:C++ SetVariable函数的具体用法?C++ SetVariable怎么用?C++ SetVariable使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetVariable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnsyncVariables
/*
* UnsyncVariables
*
* Clear variables that should be not be set when there is no connection.
*/
void
UnsyncVariables(void)
{
SetVariable(pset.vars, "DBNAME", NULL);
SetVariable(pset.vars, "USER", NULL);
SetVariable(pset.vars, "HOST", NULL);
SetVariable(pset.vars, "PORT", NULL);
SetVariable(pset.vars, "ENCODING", NULL);
}
示例2: writeRep
void CGenerator::VarDeclMap()
{
// verbose output
writeRep(" $(type) $(name); // $(alias) (map)\n", stdout);
// do the work
// write map declaration
writeVarDeclMap();
// reset item and id to standard
SetVariable(CGenerator::VAR_ITEM, mpszItem);
SetVariable(CGenerator::VAR_ID, mpszId);
}
示例3: SetOutputFileBasename
CGenerator::CGenerator()
{
SetOutputFileBasename("struct");
for (int n=0; n<eFileCount; ++n)
{
mOutputFiles[n] = 0;
}
SetVariable(VAR_PACKAGE, PACKAGE_STRING);
SetVariable(VAR_BUGREPORT, PACKAGE_BUGREPORT);
}
示例4: temp
void Shader::GetRequiredParameters(SOC_byte *outMatrixParamters, SOC_byte *outLightParameters, char *technique)
{
if(IsParameterUsed(BasicParameterNames::GetWorldMatrix(), technique))
requiredMatrixParam |= REQUIRED_TRANSFORM::WORLD;
if(IsParameterUsed(BasicParameterNames::GetViewMatrix(), technique))
requiredMatrixParam |= REQUIRED_TRANSFORM::VIEW;
if(IsParameterUsed(BasicParameterNames::GetProjMatrix(), technique))
requiredMatrixParam |= REQUIRED_TRANSFORM::PROJECTION;
if(IsParameterUsed(BasicParameterNames::GetViewProjMatrix(), technique))
requiredMatrixParam |= REQUIRED_TRANSFORM::VIEW_PROJECTION;
if(IsParameterUsed(BasicParameterNames::GetWorldViewProjMatrix(), technique))
requiredMatrixParam |= REQUIRED_TRANSFORM::WORLD_VIEW_PROJECTION;
if(IsParameterUsed(BasicParameterNames::GetWorldViewInvTnsMatrix(), technique))
requiredMatrixParam |= REQUIRED_TRANSFORM::WORLD_VIEW_INV_TRANS;
const char *structName = nullptr;
//bool test;// = shader->SetValue("material.ambient", nullptr, sizeof(float));
std::string &checkParam = BasicParameterNames::GetMaterialElement(BasicParameterNames::GetAmbient());
SOC_Vector4 temp(0, 0, 0, 0);
if(SetVariable(checkParam.c_str(), &temp))
{
requiredLightParam |= REQUIRED_LIGHTING::MATERIAL;
float tempfloat = 0.0f;
if(SetVariable(BasicParameterNames::GetMaterialElement(BasicParameterNames::GetMaterialShininess()).c_str(), tempfloat))
requiredLightParam |= REQUIRED_LIGHTING::MATERIAL_SHININESS;
}
structName = shader->GetParameterElement(BasicParameterNames::GetLight(), 0);
if(structName != nullptr)
{
requiredLightParam |= REQUIRED_LIGHTING::LIGHT;
if(shader->GetParameterByName(structName, BasicParameterNames::GetLightRange()) != nullptr)
requiredLightParam |= REQUIRED_LIGHTING::LIGHT_RANGE;
if(shader->GetParameterByName(structName, BasicParameterNames::GetLightSpotAngle()) != nullptr)
requiredLightParam |= REQUIRED_LIGHTING::LIGHT_SPOTANGLE;
}
if(outMatrixParamters)
*outMatrixParamters = requiredMatrixParam;
if(outLightParameters)
*outLightParameters = requiredLightParam;
}
示例5: Filter
int Filter(
DWORD pid, char *path
) {
vmdb *vdb = (vmdb *)malloc(sizeof(vmdb));
TCHAR sProcessName[MAX_PATH] = { 0 };
char ctemp[MAX_PATH] = { 0 };
vdb = SetVariable(path);
HANDLE hHandle = OpenProcess(
PROCESS_QUERY_INFORMATION |
PROCESS_VM_READ, FALSE, pid);
if (hHandle) {
GetModuleFileNameEx(hHandle, 0, sProcessName, MAX_PATH);
WideCharToMultiByte(CP_ACP, 0, sProcessName, MAX_PATH, ctemp, MAX_PATH, NULL, NULL);
CloseHandle(hHandle);
for (unsigned int i = 0; i < vdb->num; i++) {
if (strstr(ctemp, vdb->vm_data[i])) {
free(vdb);
return 1;
}
}
}
free(vdb);
return 0;
}
示例6: SetVariable
void ZConfigFile::SetBool(std::string section, std::string var, bool val)
{
std::string tmp = val ? "true" : "false";
section = '[' + section + ']';
SetVariable(section,var,tmp);
}
示例7: strnuprcpy
//respawn nameless after he bit the dust
void IniSpawn::RespawnNameless()
{
Game *game = core->GetGame();
Actor *nameless = game->GetPC(0, false);
if (NamelessSpawnPoint.isnull()) {
core->GetGame()->JoinParty(nameless,JP_INITPOS);
NamelessSpawnPoint=nameless->Pos;
strnuprcpy(NamelessSpawnArea, nameless->Area, 8);
}
nameless->Resurrect();
//hardcoded!!!
if (NamelessState==36) {
nameless->SetStance(IE_ANI_PST_START);
}
int i;
for (i=0;i<game->GetPartySize(false);i++) {
MoveBetweenAreasCore(game->GetPC(i, false),NamelessSpawnArea,NamelessSpawnPoint,-1, true);
}
//certain variables are set when nameless dies
for (i=0;i<namelessvarcount;i++) {
SetVariable(game, NamelessVar[i].Name,"GLOBAL", NamelessVar[i].Value);
}
}
示例8: SetContourNLevels
void
ContourOpAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ContourOpAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("contourNLevels")) != 0)
SetContourNLevels(node->AsInt());
if((node = searchNode->GetNode("contourValue")) != 0)
SetContourValue(node->AsDoubleVector());
if((node = searchNode->GetNode("contourPercent")) != 0)
SetContourPercent(node->AsDoubleVector());
if((node = searchNode->GetNode("contourMethod")) != 0)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 3)
SetContourMethod(ContourMethod(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
ContourMethod value;
if(ContourMethod_FromString(node->AsString(), value))
SetContourMethod(value);
}
}
if((node = searchNode->GetNode("minFlag")) != 0)
SetMinFlag(node->AsBool());
if((node = searchNode->GetNode("maxFlag")) != 0)
SetMaxFlag(node->AsBool());
if((node = searchNode->GetNode("min")) != 0)
SetMin(node->AsDouble());
if((node = searchNode->GetNode("max")) != 0)
SetMax(node->AsDouble());
if((node = searchNode->GetNode("scaling")) != 0)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 2)
SetScaling(ContourScaling(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
ContourScaling value;
if(ContourScaling_FromString(node->AsString(), value))
SetScaling(value);
}
}
if((node = searchNode->GetNode("variable")) != 0)
SetVariable(node->AsString());
}
示例9: InitInterface_RR
void InitInterface_RR(string iniName,ref myCh,ref enemyCh)
{
refMyCharacter = myCh;
refEnemyCharacter = enemyCh;
GameInterface.title = "titleRansack";
SendMessage(&GameInterface,"ls",MSG_INTERFACE_INIT,iniName);
SetVariable();
ref shipRef = GetShipByType(sti(refMyCharacter.ship.Type));
CreateImage("myShip","SHIPS",shipRef.name,32,39,160,167);
CreateImage("myFace","FACE128_"+refMyCharacter.FaceId,"face",164,39,292,167);
CreateString(TRUE,"MyShipType",XI_ConvertString(shipRef.Name),FONT_NORMAL,COLOR_NORMAL,96,140,SCRIPT_ALIGN_CENTER,1.0);
CreateString(TRUE,"MyShipName",refMyCharacter.ship.Name,FONT_NORMAL,COLOR_NORMAL,177,198,SCRIPT_ALIGN_CENTER,1.0);
shipRef = GetShipByType(sti(refEnemyCharacter.ship.Type));
CreateImage("enemyShip","SHIPS",shipRef.name,480,39,608,167);
CreateImage("enemyFace","FACE128_"+refEnemyCharacter.FaceId,"face",348,39,476,167);
CreateString(TRUE,"EnemyShipType",XI_ConvertString(shipRef.Name),FONT_NORMAL,COLOR_NORMAL,544,140,SCRIPT_ALIGN_CENTER,1.0);
CreateString(TRUE,"EnemyShipName",refEnemyCharacter.ship.Name,FONT_NORMAL,COLOR_NORMAL,463,198,SCRIPT_ALIGN_CENTER,1.0);
CreateString(TRUE,"String1",XI_ConvertString(str1),FONT_NORMAL,COLOR_NORMAL,320,240,SCRIPT_ALIGN_CENTER,1.0);
CreateString(TRUE,"String2",XI_ConvertString(str2),FONT_NORMAL,COLOR_NORMAL,320,268,SCRIPT_ALIGN_CENTER,1.0);
CreateString(TRUE,"String3",XI_ConvertString(str3_1)+" "+nSurrenderedMen+" "+XI_ConvertString(str3_2),FONT_NORMAL,COLOR_NORMAL,320,296,SCRIPT_ALIGN_CENTER,1.0);
SetEventHandler("InterfaceBreak","ProcessCancelExit",0);
SetEventHandler("InterfaceCancel","ProcessCancelExit",0);
SetEventHandler("KillPress","KillProcess",0);
SetEventHandler("SlavesPress","SlavesProcess",0);
}
示例10: row
int SolverFormulacaoPadrao::AddEllipsoidalConstraint(
const vector<const ProblemSolution*>& x, OPT_ROW::ROWSENSE constraint_sense, int RHS) {
// creates the constraint
int cons_row = lp_->getNumRows();
int nnz = problem_data_->n() * 2;
OPT_ROW row(nnz, constraint_sense, RHS, NULL);
lp_->addRow(row);
// for each task
for (int task = 0; task < problem_data_->n(); ++task) {
// counts the weight of every machine assignment
map<int, int> machine_to_counts;
for (int sol = 0; sol < x.size(); ++sol) {
machine_to_counts[x[sol]->assignment(task)] += 1;
}
// adds to the model
for (map<int, int>::iterator it = machine_to_counts.begin();
it != machine_to_counts.end(); ++it) {
int machine = it->first;
int count = it->second;
SetVariable(cons_row, task, machine, count);
}
}
return cons_row;
}
示例11: sprintf
void ZConfigFile::SetInt(std::string section, std::string var, int val)
{
char buf[20];
sprintf(buf,"%d",val);
section = '[' + section + ']';
SetVariable(section,var,buf);
}
示例12: SpawnGroup
//execute the initial spawn
void IniSpawn::InitialSpawn()
{
SpawnGroup(enterspawn);
//these variables are set when entering first
for (int i=0;i<localscount;i++) {
SetVariable(map, Locals[i].Name,"LOCALS", Locals[i].Value);
}
}
示例13: SetVariable
bool Shader::SetStructVariable(const char *variableName, const char *component, void* data, SOC_uint size)
{
std::string parameter = variableName;
parameter += ".";
parameter += component;
return SetVariable(parameter.c_str(), data, size);
}
示例14: FindCommand
VariableSetReturnValue CommandMap::SetVariable(const std::string& name, std::string& value, std::string& previousValue)
{
auto command = FindCommand(name);
if (!command)
return eVariableSetReturnValueError;
return SetVariable(command, value, previousValue);
}
示例15: SetVariable
bool InterpretedVM::SetVariable(std::string name, void* value) {
for (auto& nameOp : prog.Names) {
if (nameOp.second.Name == name) {
return SetVariable(nameOp.second.TargetId, value);
}
}
return false;
}