• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Object函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: create_object_only

Object create_object_only(CStrRef s, ObjectData *root) {
  return Object();
}
开发者ID:ArPharazon,项目名称:hiphop-php,代码行数:3,代码来源:externals.cpp


示例2: Object

namespace HPHP {

const Object Object::s_nullObject = Object();

///////////////////////////////////////////////////////////////////////////////

void Object::compileTimeAssertions() {
  static_assert(sizeof(Object) == sizeof(ObjectBase), "Fix this.");
}

void ObjNR::compileTimeAssertions() {
  static_assert(offsetof(ObjNR, m_px) == kExpectedMPxOffset, "");
}

Object::~Object() {
  // force it out of line
}

Array Object::toArray() const {
  return m_px ? m_px->o_toArray() : Array();
}

String Object::toString() const {
  return m_px ? m_px->invokeToString() : String();
}

int64_t Object::toInt64ForCompare() const {
  check_collection_compare(m_px);
  return toInt64();
}

double Object::toDoubleForCompare() const {
  check_collection_compare(m_px);
  return toDouble();
}

bool Object::equal(const Object& v2) const {
  if (m_px == v2.get()) {
    return true;
  }
  if (!m_px || !v2.get()) {
    return false;
  }
  if (m_px->isCollection()) {
    return collectionEquals(m_px, v2.get());
  }
  if (UNLIKELY(m_px->instanceof(SystemLib::s_DateTimeInterfaceClass))) {
    return c_DateTime::GetTimestamp(*this) ==
        c_DateTime::GetTimestamp(v2);
  }
  if (v2.get()->getVMClass() != m_px->getVMClass()) {
    return false;
  }
  if (UNLIKELY(m_px->instanceof(SystemLib::s_ArrayObjectClass))) {
    // Compare the whole object, not just the array representation
    Array ar1(ArrayData::Create());
    Array ar2(ArrayData::Create());
    m_px->o_getArray(ar1, false);
    v2->o_getArray(ar2, false);
    return ar1->equal(ar2.get(), false);
  }
  return toArray().equal(v2.toArray());
}

bool Object::less(const Object& v2) const {
  check_collection_compare(m_px, v2.get());
  if (UNLIKELY(m_px->instanceof(SystemLib::s_DateTimeInterfaceClass))) {
    return c_DateTime::GetTimestamp(*this) <
        c_DateTime::GetTimestamp(v2);
  }
  return m_px != v2.m_px && toArray().less(v2.toArray());
}

bool Object::more(const Object& v2) const {
  check_collection_compare(m_px, v2.get());
  if (UNLIKELY(m_px->instanceof(SystemLib::s_DateTimeInterfaceClass))) {
    return c_DateTime::GetTimestamp(*this) >
        c_DateTime::GetTimestamp(v2);
  }
  return m_px != v2.m_px && toArray().more(v2.toArray());
}

static Variant warn_non_object() {
  raise_warning("Cannot access property on non-object");
  return uninit_null();
}

Variant Object::o_get(const String& propName, bool error /* = true */,
                      const String& context /* = null_string */) const {
  if (UNLIKELY(!m_px)) return warn_non_object();
  return m_px->o_get(propName, error, context);
}

Variant Object::o_set(const String& propName, const Variant& val,
                      const String& context /* = null_string */) {
  if (!m_px) {
    setToDefaultObject();
  }
  return m_px->o_set(propName, val, context);
}
//.........这里部分代码省略.........
开发者ID:409033632,项目名称:hhvm,代码行数:101,代码来源:type-object.cpp


示例3: Object

Object Object::fiberUnmarshal(FiberReferenceMap &refMap) const {
  if (m_px) {
    return m_px->fiberUnmarshal(refMap);
  }
  return Object();
}
开发者ID:eliotsolomon,项目名称:hiphop-php,代码行数:6,代码来源:type_object.cpp


示例4: LOG_DEBUG

void Master::pyRegisterAllClasses(){

	LOG_DEBUG("called with "<<modulePluginClasses.size()<<" module+class pairs.");
	std::map<std::string,py::object> pyModules;
	py::object wooScope=boost::python::import("woo");

	auto synthesizePyModule=[&](const string& modName){
		py::object m(py::handle<>(PyModule_New(("woo."+modName).c_str())));
		m.attr("__file__")="<synthetic>";
		wooScope.attr(modName.c_str())=m;
		pyModules[modName.c_str()]=m;
		// http://stackoverflow.com/questions/11063243/synethsized-submodule-from-a-import-b-ok-vs-import-a-b-error/11063494
		py::extract<py::dict>(py::getattr(py::import("sys"),"modules"))()[("woo."+modName).c_str()]=m;
		LOG_DEBUG_EARLY("Synthesized new module woo."<<modName);
	};

	// this module is synthesized for core.Master; other synthetic modules are created on-demand in the loop below
	synthesizePyModule("core");
	py::scope core(py::import("woo.core"));

	this->pyRegisterClass();
	woo::ClassTrait::pyRegisterClass();
	woo::AttrTraitBase::pyRegisterClass();
	woo::TimingDeltas::pyRegisterClass();
	Object().pyRegisterClass(); // virtual method, therefore cannot be static

	// http://boost.2283326.n4.nabble.com/C-sig-How-to-create-package-structure-in-single-extension-module-td2697292.html

	list<pair<string,shared_ptr<Object>>> pythonables;
	for(const auto& moduleName: modulePluginClasses){
		string module(moduleName.first);
		string name(moduleName.second);
		shared_ptr<Object> obj;
		try {
			LOG_DEBUG("Factoring class "<<name);
			obj=factorClass(name);
			assert(obj);
			// needed for Master::childClasses
			for(int i=0;i<obj->getBaseClassNumber();i++) classBases[name].insert(obj->getBaseClassName(i));
			// needed for properly initialized class indices
			Indexable* indexable=dynamic_cast<Indexable*>(obj.get());
			if(indexable) indexable->createIndex();
			//
			if(pyModules.find(module)==pyModules.end()){
				try{
					// module existing as file, use it
					pyModules[module]=py::import(("woo."+module).c_str());
				} catch (py::error_already_set& e){
					// PyErr_Print shows error and clears error indicator
					if(getenv("WOO_DEBUG")) PyErr_Print();
					// this only clears the the error indicator
					else PyErr_Clear(); 
					synthesizePyModule(module);
				}
			}
			pythonables.push_back(make_pair(module,obj));
		}
		catch (std::runtime_error& e){
			/* FIXME: this catches all errors! Some of them are not harmful, however:
			 * when a class is not factorable, it is OK to skip it; */	
			 cerr<<"Caught non-critical error for class "<<module<<"."<<name;
		}
	}

	// handle Object specially
	// py::scope _scope(pyModules["core"]);
	// Object().pyRegisterClass(pyModules["core"]);

	/* python classes must be registered such that base classes come before derived ones;
	for now, just loop until we succeed; proper solution will be to build graphs of classes
	and traverse it from the top. It will be done once all classes are pythonable. */
	for(int i=0; i<11 && pythonables.size()>0; i++){
		if(i==10) throw std::runtime_error("Too many attempts to register python classes. Run again with WOO_DEBUG=1 to get better diagnostics.");
		LOG_DEBUG_EARLY_FRAGMENT(endl<<"[[[ Round "<<i<<" ]]]: ");
		std::list<string> done;
		for(auto I=pythonables.begin(); I!=pythonables.end(); ){
			const std::string& module=I->first;
			const shared_ptr<Object>& s=I->second;
			const std::string& klass=s->getClassName();
			try{
				LOG_DEBUG_EARLY_FRAGMENT("{{"<<klass<<"}}");
				py::scope _scope(pyModules[module]);
				s->pyRegisterClass();
				auto prev=I++;
				pythonables.erase(prev);
			} catch (...){
				LOG_DEBUG_EARLY("["<<klass<<"]");
				if(getenv("WOO_DEBUG")) PyErr_Print();
				else PyErr_Clear();
				I++;
			}
		}
	}
}
开发者ID:Azeko2xo,项目名称:woodem,代码行数:94,代码来源:Master.cpp


示例5: invokeImpl


//.........这里部分代码省略.........

  // for TestExtArray::test_array_udiff
  if (strcasecmp(function, "comp_func") == 0) {
    int n1 = params[0].toInt32();
    int n2 = params[1].toInt32();
    if (n1 == n2) return 0;
    return n1 > n2 ? 1 : -1;
  }

  // for TestExtArray::test_usort
  if (strcasecmp(function, "reverse_comp_func") == 0) {
    int n1 = params[0].toInt32();
    int n2 = params[1].toInt32();
    if (n1 == n2) return 0;
    return n1 > n2 ? -1 : 1;
  }

  // for TestExtArray::test_array_uintersect
  if (strcasecmp(function, "strcasecmp") == 0) {
    String s1 = params[0].toString();
    String s2 = params[1].toString();
    return strcasecmp(s1.data(), s2.data());
  }

  // for TestExtArray::test_uasort
  if (strcasecmp(function, "reverse_strcasecmp") == 0) {
    String s1 = params[0].toString();
    String s2 = params[1].toString();
    return strcasecmp(s2.data(), s1.data());
  }

  // for TestExtFbml
  if (strcasecmp(function, "urltr") == 0) {
    String s1 = params[0].toString();
    String s2 = params[1].toString();
    return String("url:") + s1 + "=" + s2;
  }

  // for TestExtCurl::test_curl_exec
  if (strcasecmp(function, "curl_write_func") == 0) {
    print("curl_write_func called with ");
    print(params[1]);
    return params[1].toString().size();
  }

  // for TestExtPreg::test_preg_replace
  if (strcasecmp(function, "strtoupper") == 0) {
    return f_strtoupper(params[0].toString());
  }
  if (strcasecmp(function, "test_preg_rep") == 0) {
    return test_preg_rep(params[0].toString(), params[1].toString(),
                       params[2].toString());
  }
  if (strcasecmp(function, "sprintf") == 0) {
    return f_sprintf(params.size(), params[0],
                     params.slice(1, params.size() - 1, false));
  }

  // for TestExtSqlite3::test_sqlite3
  if (strcasecmp(function, "lower") == 0) {
    return f_strtolower(params[0]);
  }
  if (strcasecmp(function, "sumlen_step") == 0) {
    return params[0].toInt64() + f_strlen(params[2]);
  }
  if (strcasecmp(function, "sumlen_fini") == 0) {
    return params[0].toInt64();
  }

  // for TestExtSoap
  if (strcasecmp(function, "hello") == 0) {
    return "Hello World";
  }
  if (strcasecmp(function, "add") == 0) {
    return params[0].toInt32() + params[1].toInt32();
  }
  if (strcasecmp(function, "sub") == 0) {
    return params[0].toInt32() - params[1].toInt32();
  }
  if (strcasecmp(function, "sum") == 0) {
    int sum = 0;
    for (ArrayIter iter(params[0]); iter; ++iter) {
      sum += iter.second().toInt32();
    }
    return sum;
  }
  if (strcasecmp(function, "strlen") == 0) {
    return f_strlen(params[0]);
  }
  if (strcasecmp(function, "fault") == 0) {
    return Object((NEWOBJ(c_SoapFault)())->create("MyFault","My fault string"));
  }

  // for TestExtServer
  if (strcasecmp(function, "xbox_process_message") == 0) {
    return StringUtil::Reverse(params[0]);
  }

  return true;
}
开发者ID:gavingeng,项目名称:hiphop-php,代码行数:101,代码来源:test_externals.cpp


示例6: Object

Object c_WaitableWaitHandle::t_getcreator() {
  return Object();
}
开发者ID:jiedo,项目名称:hhvm,代码行数:3,代码来源:waitable_wait_handle.cpp


示例7: Object

Object ResourceData::fiberUnmarshal(FiberReferenceMap &refMap) const {
  return Object();
}
开发者ID:Bittarman,项目名称:hiphop-php,代码行数:3,代码来源:resource_data.cpp


示例8: createBacktrace


//.........这里部分代码省略.........
      if (opAtPrevPc == Op::PopR ||
          opAtPrevPc == Op::UnboxR ||
          opAtPrevPc == Op::UnboxRNop) {
        pcAdjust = 1;
      }
      frame.set(s_line,
                prevFp->m_func->unit()->getLineNumber(prevPc - pcAdjust));
    }

    // check for include
    String funcname = const_cast<StringData*>(fp->m_func->name());
    if (fp->m_func->isClosureBody()) {
      static StringData* s_closure_label =
        makeStaticString("{closure}");
      funcname = s_closure_label;
    }

    // check for pseudomain
    if (funcname.empty()) {
      if (!prevFp && !btArgs.m_withPseudoMain) continue;
      else if (!prevFp) funcname = s_main;
      else funcname = s_include;
    }

    frame.set(s_function, funcname);

    if (!funcname.same(s_include)) {
      // Closures have an m_this but they aren't in object context
      Class* ctx = arGetContextClass(fp);
      if (ctx != nullptr && !fp->m_func->isClosureBody()) {
        frame.set(s_class, ctx->name()->data());
        if (fp->hasThis() && !isReturning) {
          if (btArgs.m_withThis) {
            frame.set(s_object, Object(fp->getThis()));
          }
          frame.set(s_type, "->");
        } else {
          frame.set(s_type, "::");
        }
      }
    }

    Array args = Array::Create();
    bool withNames = btArgs.m_withArgNames;
    bool withValues = btArgs.m_withArgValues;
    if (!btArgs.m_withArgNames && !btArgs.m_withArgValues) {
      // do nothing
    } else if (funcname.same(s_include)) {
      if (depth) {
        args.append(const_cast<StringData*>(curUnit->filepath()));
        frame.set(s_args, args);
      }
    } else if (!RuntimeOption::EnableArgsInBacktraces || isReturning) {
      // Provide an empty 'args' array to be consistent with hphpc
      frame.set(s_args, args);
    } else {
      const int nparams = fp->m_func->numNonVariadicParams();
      int nargs = fp->numArgs();
      int nformals = std::min(nparams, nargs);

      if (UNLIKELY(fp->hasVarEnv() && fp->getVarEnv()->getFP() != fp)) {
        // VarEnv is attached to eval or debugger frame, other than the current
        // frame. Access locals thru VarEnv.
        auto varEnv = fp->getVarEnv();
        auto func = fp->func();
        for (int i = 0; i < nformals; i++) {
开发者ID:AmineCherrai,项目名称:hhvm,代码行数:67,代码来源:backtrace.cpp


示例9: return

 List::Proxy::operator py::Object () const
 {
     return (Object(::fetch(myList->handle(), myIndex)));
 }
开发者ID:AndreLouisCaron,项目名称:cxxpy,代码行数:4,代码来源:List.cpp


示例10: TEST

TEST(Object, Casts) {
  // Test cast operations
  {
    EXPECT_FALSE(isa<c_Vector>(Object()));
    EXPECT_TRUE(isa_or_null<c_Vector>(Object()));

    auto dummy = req::make<c_Vector>();
    Object res(dummy);
    Object empty;
    EXPECT_TRUE(isa<c_Vector>(res));
    EXPECT_TRUE(isa_or_null<c_Vector>(res));

    EXPECT_FALSE(isa<c_Map>(res));
    EXPECT_FALSE(isa_or_null<c_Map>(res));

    // cast tests
    // Bad types and null pointers should throw.
    EXPECT_EQ(cast<c_Vector>(res), dummy);
    EXPECT_EQ(cast<ObjectData>(res), dummy);
    try {
      cast<c_Map>(res);
      EXPECT_FALSE(true);
    } catch(...) {
      EXPECT_TRUE(true);
    }
    try {
      cast<c_Vector>(empty);
      EXPECT_FALSE(true);
    } catch(...) {
      EXPECT_TRUE(true);
    }

    // cast_or_null tests
    // Bad types should throw, null pointers are ok.
    EXPECT_EQ(cast_or_null<ObjectData>(empty), nullptr);
    EXPECT_EQ(cast_or_null<ObjectData>(res), dummy);

    try {
      cast_or_null<c_Map>(res);
      EXPECT_FALSE(true);
    } catch(...) {
      EXPECT_TRUE(true);
    }

    // dyn_cast tests
    // Bad types are ok, null pointers should throw.
    EXPECT_EQ(dyn_cast<c_Vector>(res), dummy);
    EXPECT_EQ(dyn_cast<ObjectData>(res), dummy);
    EXPECT_EQ(dyn_cast<c_Map>(res), nullptr);

    try {
      dyn_cast<c_Vector>(empty);
      EXPECT_FALSE(true);
    } catch(...) {
      EXPECT_TRUE(true);
    }

    // dyn_cast_or_null
    // Bad types and null pointers are ok.  Should never throw.
    EXPECT_EQ(dyn_cast_or_null<c_Map>(res), nullptr);
    EXPECT_EQ(dyn_cast_or_null<ObjectData>(res), dummy);
    EXPECT_EQ(dyn_cast_or_null<ObjectData>(empty), nullptr);
  }
}
开发者ID:gkz,项目名称:hhvm,代码行数:64,代码来源:object.cpp


示例11: Node

	  Node(const Object& d = Object(),Node *p = NULL,Node *q=NULL):data(d),prev(p),next(q){}
开发者ID:naveenmiriyalu,项目名称:Algorithms,代码行数:1,代码来源:List.cpp


示例12: DoStartSzen

func DoStartSzen()
{

	RemoveAll(TIME);
	CreateObject(DARK,0,0,-1);
	CreateObject(TIME,0,0,-1);

	FindObjects( Find_Func("SetLightOff",1) );
	FindObjects( Find_Func("SetLightOn") );


	giPlrEnemy = 0;
	giPlrFriend = 1;

	gpIntroCandle1 = Object(302);
	gpIntroCandle2 = Object(303);
	gpIntroCandle3 = Object(301);
	gpIntroChandelier = Object(300);
	gpIntroTorch = Object(211);

	gDrawbridge = FindObject(CPT3);

	// Glühwürmchen erstellen

	CreateObject(FFAC, 627, 705, -1);
	CreateObject(FFAC, 1905, 770, -1);
	CreateObject(FFAC, 2170, 745, -1);
	CreateObject(FFAC, 2675, 490, -1);

	// Königin erstellen
	gNPCQueen = CreateObject( _PRC,0,0,giPlrFriend);
	MakeCrewMember( gNPCQueen, giPlrFriend );
	gNPCQueen->SetPosition(40,660);
	gNPCQueen->SetDir(1);
	gNPCQueen->SetName("$NPCQueen$");
	//AttachDialogue(gNPCQueen,"");

	// Hexe erstellen
	gNPCWitch = CreateObject( CLNK,0,0,giPlrFriend );
	MakeCrewMember( gNPCWitch, giPlrFriend );
	gNPCWitch->~SetName("Frau");
	gNPCWitch->~SetPosition(1170,750);
	AttachDialogue(gNPCWitch,"Alvelin");
	CreateContents(TIM1,gNPCWitch); // a dummy such that he does not collect the last barrel after ejecting it
	CreateContents(LAXE,gNPCWitch); // lumberjack's axe for looting the witch

	// Schmied erstellen
	gNPCBlacksmith = CreateObject( CLNK,0,0,giPlrFriend );
	MakeCrewMember( gNPCBlacksmith, giPlrFriend );
	gNPCBlacksmith->~SetName("Heinz");
	gNPCBlacksmith->~SetPosition(1515,770);
	AttachDialogue(gNPCBlacksmith,"Heinz");

	// Erfinder erstellen
	gNPCInventor = CreateObject( CLNK,0,0,giPlrFriend );
	MakeCrewMember( gNPCInventor, giPlrFriend );
	gNPCInventor->~SetName("Ingalf");
	gNPCInventor->SetPosition(865,800);
	AttachDialogue(gNPCInventor,"Ingalf");

	// Bürger erstellen
	gNPCCitizen = CreateObject( CLNK,0,0,giPlrFriend );
	MakeCrewMember( gNPCCitizen, giPlrFriend );
	gNPCCitizen->~SetName("Odilbert");
	gNPCCitizen->SetPosition(1215,750);
	AttachDialogue(gNPCCitizen,"Odilbert");

	// Abenteurer erstellen
	gNPCAdventurer1 = CreateObject( CLNK,0,0,giPlrFriend );
	MakeCrewMember( gNPCAdventurer1, giPlrFriend );
	gNPCAdventurer1->~SetName("Gernot");
	gNPCAdventurer1->SetPosition(2715,495);
	AttachDialogue(gNPCAdventurer1,"Gernot");

	// Abenteurer erstellen
	gNPCAdventurer2 = CreateObject( CLNK,0,0,giPlrFriend );
	MakeCrewMember( gNPCAdventurer2, giPlrFriend );
	gNPCAdventurer2->~SetName("Linnert");
	gNPCAdventurer2->SetPosition(2740,495);
	AttachDialogue(gNPCAdventurer2,"Linnert");

	// Farmer erstellen
	gNPCFarmer = CreateObject( CLNK,0,0,giPlrFriend );
	MakeCrewMember( gNPCFarmer, giPlrFriend );
	gNPCFarmer->~SetName("Armin");
	gNPCFarmer->SetPosition(1840,765);
	AttachDialogue(gNPCFarmer,"Armin");
	AttachDayNightCycle(gNPCFarmer,"Armin");
	CreateContents(TIM1,gNPCFarmer); // a dummy such that he does not collect items

	// Wirtin erstellen
	gNPCInnkeeper = CreateObject( CLNK,0,0,giPlrFriend );
	MakeCrewMember( gNPCInnkeeper, giPlrFriend );
	gNPCInnkeeper->~SetName("Bernika");
	gNPCInnkeeper->SetPosition(1315,750);
	AttachDialogue(gNPCInnkeeper,"Bernika");

	// Dirne erstellen
	gNPCProstitute = CreateObject( CLNK,0,0,giPlrFriend );
	MakeCrewMember( gNPCProstitute, giPlrFriend );
//.........这里部分代码省略.........
开发者ID:Froggit,项目名称:Data_Project1_Repos1,代码行数:101,代码来源:Script.c


示例13: Object

//Object
Object::Object() {
    Object(0, 0, 0, 0, 0, 0, 0, -1);
}
开发者ID:Ascension64,项目名称:TobEx,代码行数:4,代码来源:scrcore.cpp


示例14: event_http_request_cb

 static void event_http_request_cb(evhttp_request_t *request, void *data) {
     EventHttpRequestResourceData *resource_data = (EventHttpRequestResourceData *) data;
     evhttp_request_own((evhttp_request_t *) resource_data->getInternalResourceData());
     vm_call_user_func(Object(resource_data->getCallback()), make_packed_array(Object(resource_data->getObjectData()), resource_data->getCallbackArg()));
 }
开发者ID:RickySu,项目名称:hhvm-ext-event,代码行数:5,代码来源:ext_event_http_request.cpp


示例15: Object

namespace HPHP {

const Object Object::s_nullObject = Object();

///////////////////////////////////////////////////////////////////////////////

HOT_FUNC
Object::~Object() {
  if (LIKELY(m_px != 0)) {
    if (UNLIKELY(m_px->decRefCount() == 0)) {
      m_px->destruct();
      if (LIKELY(m_px->getCount() == 0)) {
        delete m_px;
      }
    }
  }
}

ArrayIter Object::begin(const String& context /* = null_string */) const {
  if (!m_px) throw_null_pointer_exception();
  return m_px->begin(context);
}

MutableArrayIter Object::begin(Variant *key, Variant &val,
                               const String& context /*= null_string*/) const {
  if (!m_px) throw_null_pointer_exception();
  return m_px->begin(key, val, context);
}

Array Object::toArray() const {
  return m_px ? m_px->o_toArray() : Array();
}

int64_t Object::toInt64ForCompare() const {
  check_collection_compare(m_px);
  return toInt64();
}

double Object::toDoubleForCompare() const {
  check_collection_compare(m_px);
  return toDouble();
}

bool Object::equal(CObjRef v2) const {
  if (m_px == v2.get()) {
    return true;
  }
  if (!m_px || !v2.get()) {
    return false;
  }
  if (v2.get()->getVMClass() != m_px->getVMClass()) {
    return false;
  }
  if (m_px->isCollection()) {
    return collectionEquals(m_px, v2.get());
  }
  return toArray().equal(v2.toArray());
}

bool Object::less(CObjRef v2) const {
  check_collection_compare(m_px, v2.get());
  return m_px != v2.m_px && toArray().less(v2.toArray());
}

bool Object::more(CObjRef v2) const {
  check_collection_compare(m_px, v2.get());
  return m_px != v2.m_px && toArray().more(v2.toArray());
}

static Variant warn_non_object() {
  raise_warning("Cannot access property on non-object");
  return uninit_null();
}

Variant Object::o_get(const String& propName, bool error /* = true */,
                      const String& context /* = null_string */) const {
  if (UNLIKELY(!m_px)) return warn_non_object();
  return m_px->o_get(propName, error, context);
}

Variant Object::o_set(const String& propName, CVarRef val,
                      const String& context /* = null_string */) {
  if (!m_px) {
    setToDefaultObject();
  }
  return m_px->o_set(propName, val, context);
}

Variant Object::o_setRef(const String& propName, CVarRef val,
                         const String& context /* = null_string */) {
  if (!m_px) {
    setToDefaultObject();
  }
  return m_px->o_setRef(propName, val, context);
}

Variant Object::o_set(const String& propName, RefResult val,
                      const String& context /* = null_string */) {
  return o_setRef(propName, variant(val), context);
}
//.........这里部分代码省略.........
开发者ID:360buyliulei,项目名称:hiphop-php,代码行数:101,代码来源:type-object.cpp


示例16: co_stdclass

Object co_stdclass(CArrRef params, bool init /* = true */) {
  return Object((NEW(c_stdclass)())->dynCreate(params, init));
}
开发者ID:scottmac,项目名称:hiphop-dev,代码行数:3,代码来源:stdclass.cpp


示例17: Object

#include "ThreadWrapperBase.h"
#include "NativeExceptionBase.h"

#using <System.Windows.Forms.dll>

namespace ThreadManager
{
	ThreadWrapperBase::ThreadWrapperBase()
	{
		actionQueue = gcnew Queue<ActionItem^>();
		actionQueueLock = gcnew Object();
		doActionsLock = gcnew Object();
		terminated = gcnew ManualResetEvent(false);
		waitLock = gcnew ManualResetEvent(false);
		delegateDictionary = gcnew Dictionary<String^, Delegate^>();
		CreateThread();
	}

	void ThreadWrapperBase::StartThread(Object^ startArg)
	{
		thread->Start(startArg);
	}

	void ThreadWrapperBase::TerminateThread()
	{
		// set "terminated" to indicate we want to finish the thread
		if (terminated)
			terminated->Set();

		waitLock->Set();
开发者ID:vbasanovic,项目名称:Monre,代码行数:30,代码来源:ThreadWrapperBase.cpp


示例18: co___php_incomplete_class

Object co___php_incomplete_class(CArrRef params, bool init /* = true */) {
  return Object((NEW(c___php_incomplete_class)())->dynCreate(params, init));
}
开发者ID:scottmac,项目名称:hiphop-dev,代码行数:3,代码来源:stdclass.cpp


示例19: Object

namespace HPHP {

const Object Object::s_nullObject = Object();

///////////////////////////////////////////////////////////////////////////////

Array Object::toArray() const {
  return m_px ? m_px->o_toArray() : Array();
}

Variant Object::toKey() const {
  return m_px ? (isResource() ? m_px->o_toInt64() : m_px->t___tostring())
              : String();
}

bool Object::equal(CObjRef v2) const {
  if (m_px == v2.get())
    return true;
  if (!m_px || !v2.get())
    return false;
  if (isResource() || v2.isResource())
    return false;
  return (v2.get()->o_isClass(m_px->o_getClassName()) &&
          toArray().equal(v2.toArray()));
}

bool Object::less(CObjRef v2) const {
  return m_px != v2.m_px &&
    toArray().less(v2.toArray());
}

bool Object::more(CObjRef v2) const {
  return m_px != v2.m_px &&
    toArray().more(v2.toArray());
}

Variant Object::o_get(CStrRef propName, int64 hash /* = -1 */,
    bool error /* = true */) const {
  if (!m_px) throw NullPointerException();
  return m_px->o_get(propName, hash, error);
}

ObjectOffset Object::o_lval(CStrRef propName, int64 hash /* = -1 */) {
  if (!m_px) {
    operator=(NEW(c_stdclass)());
  }
  return ObjectOffset(m_px, propName, hash);
}

///////////////////////////////////////////////////////////////////////////////
// output

void Object::serialize(VariableSerializer *serializer) const {
  if (m_px) {
    m_px->serialize(serializer);
  } else {
    serializer->writeNull();
  }
}

bool Object::unserialize(std::istream &in) {
  throw NotImplementedException(__func__);
}

Object Object::fiberCopy() {
  if (m_px) {
    if (m_px->getCount() > 1) {
      ObjectData *px = (ObjectData*)FiberReferenceMap::Lookup(m_px);
      if (px == NULL) {
        px = m_px->clone();
        FiberReferenceMap::Insert(m_px, px);
      }
      return px;
    }
    return m_px->clone();
  }
  return Object();
}

///////////////////////////////////////////////////////////////////////////////
}
开发者ID:edv4rd0,项目名称:hiphop-php,代码行数:81,代码来源:type_object.cpp


示例20: Object

EquivalenceScope::Object EquivalenceScope::GetObject(ASTContext &C, const Expr *E, VarDecl *Var, uint64_t Offset) {
  return Object(E, Offset, GetObject(C, Var));
}
开发者ID:carlobertolli,项目名称:flang,代码行数:3,代码来源:SemaEquivalence.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ObjectDesc函数代码示例发布时间:2022-05-30
下一篇:
C++ ObjOf函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap