当前位置: 首页>>代码示例>>C++>>正文


C++ ArgumentArray类代码示例

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


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

示例1: RedisCommandFrame

 RedisCommandFrame(ArgumentArray& cmd) :
         type(REDIS_CMD_INVALID), m_is_inline(false), m_cmd_seted(false), m_raw_data_size(0)
 {
     m_cmd = cmd.front();
     cmd.pop_front();
     m_args = cmd;
 }
开发者ID:mrkeng,项目名称:ardb,代码行数:7,代码来源:redis_command.hpp

示例2: ExpireCheckCallback

 void ExpireCheck::ExpireCheckCallback(const DBID& db, const Slice& key, void* data)
 {
     ExpireCheck* e = (ExpireCheck*) data;
     ArgumentArray args;
     args.push_back("del");
     args.push_back(std::string(key.data(), key.size()));
     RedisCommandFrame cmd(args);
     e->m_server->GetMaster().FeedSlaves(NULL, db, cmd);
 }
开发者ID:mrkeng,项目名称:ardb,代码行数:9,代码来源:expire_check.cpp

示例3: VMFImport_Init

XSIPLUGINCALLBACK XSI::CStatus VMFImport_Init( const XSI::CRef& in_context )
{
	Context ctx(in_context);
	Command cmd(ctx.GetSource());

	cmd.EnableReturnValue ( true );


	ArgumentArray args = cmd.GetArguments();

	args.Add( L"arg0", (long)0 );
	
	return XSI::CStatus::OK;
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:14,代码来源:VMFImport.cpp

示例4: OnRawKeyValue

				int OnRawKeyValue(const Slice& key, const Slice& value)
				{
					ArgumentArray args;
					args.push_back("__SET__");
					args.push_back(std::string(key.data(), key.size()));
					args.push_back(std::string(value.data(), value.size()));
					RedisCommandFrame cmd(args);
					conn.conn->Write(cmd);
					count++;
					if (count % 10000 == 0)
					{
						conn.conn->GetService().Continue();
					}
					return 0;
				}
开发者ID:kouhate,项目名称:ardb,代码行数:15,代码来源:master.cpp

示例5: Coat3DExport_Init

XSIPLUGINCALLBACK CStatus Coat3DExport_Init( CRef& in_ctxt )
{
	Context ctxt( in_ctxt );
	Command oCmd;
	oCmd = ctxt.GetSource();
	
	// Specify that the command returns a value
	oCmd.EnableReturnValue(true);
	//Application app;
	app.LogMessage(L"Coat3DExport_Init!");

	// Add arguments to the command
	ArgumentArray oArgs;
	oArgs = oCmd.GetArguments();

	oArgs.Add(L"tempLocation", (CString)siString);
	oArgs.Add(L"coatLocation",(CString)siString);
	oArgs.Add(L"typePaint",(CValue)siUInt);
	//oArgs.Add(L"bCopyTexE",(CValue)siBool);
	oArgs.Add(L"bExpMat",(CValue)siBool);
	oArgs.Add(L"bExpUV",(CValue)siBool);
	oArgs.Add(L"bExpNorm",(CValue)siBool);

	return CStatus::OK;
}
开发者ID:oyaGG,项目名称:3DCoat_Applinks,代码行数:25,代码来源:AppLink_3DCoat_export.cpp

示例6: OgreMeshExportCommand_Init

/** Defines the arguments to the export command */
XSI::CStatus OgreMeshExportCommand_Init( const XSI::CRef& context )
{
	Context ctx(context);
	Command cmd(ctx.GetSource());

	Application app;
	app.LogMessage( L"Defining: " + cmd.GetName() );

	ArgumentArray args = cmd.GetArguments();

    args.Add( L"objectName", L"" );
	args.Add( L"targetMeshFileName", L"c:/default.mesh" );
	args.Add( L"calculateEdgeLists", L"true" );
    args.Add( L"calculateTangents", L"false" );
    args.Add( L"exportSkeleton", L"true" );
	args.Add( L"exportVertexAnimation", L"true" );
    args.Add( L"targetSkeletonFileName", L"c:/default.skeleton" );
    args.Add( L"fps", L"24" );
    args.Add( L"animationList", L"" ); 
	return XSI::CStatus::OK;

}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:23,代码来源:OgreXSIExport.cpp

示例7: GMenu_Init

/* ウィンドウクラス登録実行、XSIのウィンドウハンドル取得はここで */
XSIPLUGINCALLBACK CStatus GMenu_Init( CRef& in_ctxt )
{
	Context ctxt( in_ctxt );
	Command oCmd(ctxt.GetSource());
	oCmd.PutDescription(L"");
	oCmd.SetFlag(siCannotBeUsedInBatch,true);
	oCmd.SetFlag(siNoLogging,true);
	oCmd.EnableReturnValue(true);

	ArgumentArray oArgs = oCmd.GetArguments();
	oArgs.Add(L"MenuSetName");

	gWnd = (HWND)Application().GetDesktop().GetApplicationWindowHandle();	//XSI のウィンドウハンドル
	gInstance = GetModuleHandle(NULL);										//自分のインスタンス


	if ( myWindowClassReg( gInstance ) == 0 ) {	//ウィンドウクラス登録
		Application().LogMessage(L" cannnot regiser window class.",siVerboseMsg);
		return CStatus::False;
	}
	DebugLog(L" registered windows class.");
	return CStatus::OK;
}
开发者ID:tera256,项目名称:GMenu,代码行数:24,代码来源:GMenu.cpp

示例8: switch

Command::ArgumentArray Command::getEffectiveArguments() const {
	uint effectiveArgumentsStart;
	switch (_subTypeDesc->controlFlowType) {
		case kFlowEnd:
			effectiveArgumentsStart = 0;
			break;
		case kFlowNormal:
			effectiveArgumentsStart = 1;
			break;
		case kFlowBranch:
			effectiveArgumentsStart = 2;
			break;
		default:
			error("Unhandled control flow type '%d'", _subTypeDesc->controlFlowType);
	}

	ArgumentArray effectiveArguments;
	for (uint i = effectiveArgumentsStart; i < _arguments.size(); i++) {
		effectiveArguments.push_back(_arguments[i]);
	}

	return  effectiveArguments;
}
开发者ID:Botje,项目名称:residualvm,代码行数:23,代码来源:command.cpp

示例9: xbchangeboiler

void BSpit::xbchangeboiler(const ArgumentArray &args) {
	uint32 heat = _vm->_vars["bheat"];
	uint32 water = _vm->_vars["bblrwtr"];
	uint32 platform = _vm->_vars["bblrgrt"];

	// Stop any background videos
	_vm->_video->closeVideos();

	if (args[0] == 1) {
		// Water is filling/draining from the boiler
		if (water == 0) {
			if (platform == 1)
				_vm->getCard()->playMovie(12);
			else
				_vm->getCard()->playMovie(10);
		} else if (heat == 1) {
			if (platform == 1)
				_vm->getCard()->playMovie(22);
			else
				_vm->getCard()->playMovie(19);
		} else {
			if (platform == 1)
				_vm->getCard()->playMovie(16);
			else
				_vm->getCard()->playMovie(13);
		}
	} else if (args[0] == 2 && water != 0) {
		if (heat == 1) {
			// Turning on the heat
			if (platform == 1)
				_vm->getCard()->playMovie(23);
			else
				_vm->getCard()->playMovie(20);
		} else {
			// Turning off the heat
			if (platform == 1)
				_vm->getCard()->playMovie(18);
			else
				_vm->getCard()->playMovie(15);
		}
	} else if (args[0] == 3) {
		if (platform == 1) {
			// Lowering the platform
			if (water == 1) {
				if (heat == 1)
					_vm->getCard()->playMovie(24);
				else
					_vm->getCard()->playMovie(17);
			} else {
				_vm->getCard()->playMovie(11);
			}
		} else {
			// Raising the platform
			if (water == 1) {
				if (heat == 1)
					_vm->getCard()->playMovie(21);
				else
					_vm->getCard()->playMovie(14);
			} else {
				_vm->getCard()->playMovie(9);
			}
		}
	}

	if (args.size() > 1)
		_vm->getCard()->playSound(args[1]);
	else if (args[0] == 2)
		_vm->getCard()->playSound(1);

	RivenVideo *video = _vm->_video->openSlot(11);
	video->playBlocking();
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:72,代码来源:bspit.cpp

示例10: lua_gettop

    int LUAInterpreter::CallArdb(lua_State *lua, bool raise_error)
    {
        int j, argc = lua_gettop(lua);
        ArgumentArray cmdargs;

        /* Require at least one argument */
        if (argc == 0)
        {
            luaPushError(lua, "Please specify at least one argument for redis.call()");
            return 1;
        }

        /* Build the arguments vector */
        for (j = 0; j < argc; j++)
        {
            if (!lua_isstring(lua, j + 1))
                break;
            std::string arg;
            arg.append(lua_tostring(lua, j + 1), lua_strlen(lua, j + 1));
            cmdargs.push_back(arg);
        }

        /* Check if one of the arguments passed by the Lua script
         * is not a string or an integer (lua_isstring() return true for
         * integers as well). */
        if (j != argc)
        {
            luaPushError(lua, "Lua redis() command arguments must be strings or integers");
            return 1;
        }

        /* Setup our fake client for command execution */

        RedisCommandFrame cmd(cmdargs);
        Ardb::RedisCommandHandlerSetting* setting = g_db->FindRedisCommandHandlerSetting(cmd);
        /* Command lookup */
        if (NULL == setting)
        {
            luaPushError(lua, "Unknown Redis command called from Lua script");
            return -1;
        }

        /* There are commands that are not allowed inside scripts. */
        if (!setting->IsAllowedInScript())
        {
            luaPushError(lua, "This Redis command is not allowed from scripts");
            return -1;
        }
        LuaExecContext* ctx = g_lua_exec_ctx.GetValue();

        /* Write commands are forbidden against read-only slaves, or if a
         * command marked as non-deterministic was already called in the context
         * of this script. */
        if (setting->IsWriteCommand())
        {
            if (!g_db->GetConf().master_host.empty() && g_db->GetConf().slave_readonly && !g_db->IsLoadingData() && !(ctx->caller->flags.slave))
            {
                luaPushError(lua, "-READONLY You can't write against a read only slave.");
                return -1;
            }
        }

        Context& lua_ctx = ctx->exec;
        RedisReply& reply = lua_ctx.GetReply();
        reply.Clear();
        lua_ctx.ClearFlags();
        lua_ctx.flags.lua = 1;
        g_db->DoCall(lua_ctx, *setting, cmd);
        if (raise_error && reply.type != REDIS_REPLY_ERROR)
        {
            raise_error = 0;
        }
        redisProtocolToLuaType(lua, reply);

        if (raise_error)
        {
            /* If we are here we should have an error in the stack, in the
             * form of a table with an "err" field. Extract the string to
             * return the plain error. */
            lua_pushstring(lua, "err");
            lua_gettable(lua, -2);
            return lua_error(lua);
        }
        return 1;
    }
开发者ID:masterve,项目名称:test,代码行数:85,代码来源:lua_scripting.cpp

示例11: GetAugmentedProgram

bool csShaderGLCGCommon::DefaultLoadProgram (iShaderProgramCG* cgResolve,
  const char* programStr, ProgramType _type,
  const ProfileLimitsPair& customLimitsPair, uint flags)
{
  if (!programStr || !*programStr) return false;

  const ProfileLimits& customLimits = (_type == progVP) ?
    customLimitsPair.vp : customLimitsPair.fp;
  CGGLenum type = (_type == progVP) ? CG_GL_VERTEX : CG_GL_FRAGMENT;

  size_t i;
  csString augmentedProgramStr = GetAugmentedProgram (programStr,
    (flags & loadFlagUnusedV2FForInit) != 0);
    
  programStr = augmentedProgramStr;
  CGprofile profile = customLimits.profile;
  CS::PluginCommon::ShaderProgramPluginGL::HardwareVendor vendor =
    customLimits.vendor;

  if (shaderPlug->doVerbose || shaderPlug->doVerbosePrecache)
  {
    shaderPlug->Report (CS_REPORTER_SEVERITY_NOTIFY,
      "Cg %s program %s: using profile %s[%d]", GetProgramType(),
      CS::Quote::Single (description.GetData ()),
      cgGetProfileString (profile), profile);
  }

  ArgumentArray args;
  shaderPlug->GetProfileCompilerArgs (GetProgramType(), profile, 
    customLimitsPair,
    vendor,
    (flags & loadIgnoreConfigProgramOpts) ? csGLShader_CG::argsNoConfig
      : csGLShader_CG::argsAll, args);
  for (i = 0; i < compilerArgs.GetSize(); i++) 
    args.Push (compilerArgs[i]);
  programPositionInvariant = false;
  for (i = 0; i < args.GetSize(); ) 
  {
    if (strcmp (args[i], "-posinv") == 0)
    {
      if (profile >= CG_PROFILE_GPU_VP)
      {
	/* Work around Cg 2.0 and above (including 3.0) bug: it emits
	   "OPTION ARB_position_invariant;" AND computes result.position in
	   the VP - doing both is verboten.
	   Affected are the GP4VP and higher profiles.
	   Remedy: remove -posinv argument 
	 */
	args.DeleteIndex (i);
	continue;
      }
      programPositionInvariant = true;
    }
    i++;
  }
  customLimits.ToCgOptions (args);
  args.Push (0);
 
  if (program)
  {
    cgDestroyProgram (program);
  }
  shaderPlug->SetCompiledSource (programStr);
  shaderPlug->SetIgnoreErrors (true);
  program = cgCreateProgram (shaderPlug->context, 
    CG_SOURCE, programStr, 
    profile, !entrypoint.IsEmpty() ? entrypoint : "main", args.GetArray());
  shaderPlug->SetIgnoreErrors (false);
  
  if (!(flags & loadIgnoreErrors)) shaderPlug->PrintAnyListing();

  if (!program)
  {
    shaderPlug->SetCompiledSource (0);
    /*if (shaderPlug->debugDump)
    {
      EnsureDumpFile();
      WriteAdditionalDumpInfo ("Failed program source", programStr);
    }*/
    return false;
  }
  programProfile = cgGetProgramProfile (program);

  GetParamsFromVmapConstants();
  if (flags & loadApplyVmap)
    GetParamsFromVmap();

  if (flags & loadIgnoreErrors) shaderPlug->SetIgnoreErrors (true);
  cgCompileProgram (program);
  if (flags & loadIgnoreErrors)
    shaderPlug->SetIgnoreErrors (false);
  else
    shaderPlug->PrintAnyListing();
  
  if (flags & loadApplyVmap)
    GetPostCompileParamProps ();

  if (flags & loadLoadToGL)
  {
    cgGetError(); // Clear error
//.........这里部分代码省略.........
开发者ID:GameLemur,项目名称:Crystal-Space,代码行数:101,代码来源:glshader_cgcommon.cpp

示例12: ToString

 std::string ToString() const
 {
     std::string cmd;
     cmd.append(m_cmd).append(" ");
     for (uint32 i = 0; i < m_args.size(); i++)
     {
         cmd.append(m_args[i]);
         if (i != m_args.size() - 1)
         {
             cmd.append(" ");
         }
     }
     return cmd;
 }
开发者ID:mrkeng,项目名称:ardb,代码行数:14,代码来源:redis_command.hpp

示例13: GetArgument

 const std::string* GetArgument(uint32 index) const
 {
     if (index >= m_args.size())
     {
         return NULL;
     }
     return &(m_args[index]);
 }
开发者ID:mrkeng,项目名称:ardb,代码行数:8,代码来源:redis_command.hpp

示例14: FillNextArgument

 inline void FillNextArgument(Buffer& buf, size_t len)
 {
     const char* str = buf.GetRawReadBuffer();
     buf.AdvanceReadIndex(len);
     if (m_cmd_seted)
     {
         m_args.push_back(std::string(str, len));
     }
     else
     {
         m_cmd.append(str, len);
         m_cmd_seted = true;
     }
 }
开发者ID:mrkeng,项目名称:ardb,代码行数:14,代码来源:redis_command.hpp

示例15: Clear

 void Clear()
 {
     m_cmd_seted = false;
     m_cmd.clear();
     m_args.clear();
 }
开发者ID:mrkeng,项目名称:ardb,代码行数:6,代码来源:redis_command.hpp


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