コード例 #1
0
ファイル: 027_flow.cpp プロジェクト: BrainlessLabsInc/oglplus
	FlowSimulator(
		const images::Image& flow_map_image,
		GLuint first_tex_unit
	): size(1024)
	 , prog(size)
	 , holder(size, first_tex_unit, flow_map_image)
	 , screen(List("Position")("TexCoord").Get(), shapes::Screen(), prog)
	{
	 	Uniform<SLtoCpp<SLDataType::Sampler2D>> flow_map(prog, "FlowMap");
		flow_map.Set(holder.FlowMapUnit());

		fbo.Bind(Framebuffer::Target::Draw);
		Framebuffer::AttachColorTexture(
			Framebuffer::Target::Draw,
			0,
			holder.BumpMap(),
			0
		);
	}
コード例 #2
0
ファイル: Symbol.cpp プロジェクト: usnistgov/QIF
void ISymbol::DeepCopy(ISymbolPtr c)
{
	c->Name()=Name();

	c->Abstract() = Abstract();
	c->Atomic() = Atomic();
	c->Attributes() = Attributes();
	c->BaseTypeName() = BaseTypeName();
	c->Compositor() = Compositor();
	c->DerivedType() = DerivedType();
	c->Dimension() = Dimension();
	c->Enumerations() = Enumerations();
	c->FacetKinds() = FacetKinds();
	c->Facets() = Facets();
	c->Global() = Global();
	c->Level() = Level();
	c->List() = List();
	c->ListSize() = ListSize();
	c->ListType() = ListType();
	c->LowerBounds() = LowerBounds();
	c->Namespace() = Namespace();
	c->Optional() = Optional();
	c->OuterElementName() = OuterElementName();
	c->OuterElementTypeName() = OuterElementTypeName();
	c->Parent() = Parent();
	c->Parsed() = Parsed();
	c->PrimitiveType() = PrimitiveType();
	c->Required() = Required();
	c->SimpleContent() = SimpleContent();
	c->SimpleType() = SimpleType();
	c->SqlCount() = SqlCount();
	c->SqlType() = SqlType();
	c->SubstitutionGroupAffiliation() = SubstitutionGroupAffiliation();
	c->SubstitutionList() = SubstitutionList();
	c->SubTypes() = SubTypes();
	c->SuperTypes() =  SuperTypes();
	c->Type() = Type();
	c->TypeName() = TypeName();
	c->UpperBounds() = UpperBounds();
	c->Variable() = Variable();
	c->Visited() = Visited();
	c->XercesType() = XercesType();
}
コード例 #3
0
	FBTexExample(void)
	 : gl()
	 , vertex_shader(ObjectDesc("Vertex"))
	 , prog(make_prog())
	 , projection_matrix(prog, "ProjectionMatrix")
	 , camera_matrix(prog, "CameraMatrix")
	 , model_matrix(prog, "ModelMatrix")
	 , cube(List("Position")("Normal")("TexCoord").Get(), shapes::Cube(), prog)
	 , width(800)
	 , height(600)
	{
		UniformSampler(prog, "TexUnit").Set(0);
		Uniform<Vec3f>(prog, "LightPos").Set(40.0f, 40.0f, -80.0f);

		Texture::Active(0);
		tex.Bind(Texture::Target::_2D);

		Use();
	}
コード例 #4
0
	FBTexThread(FBTexExample& example)
	 : gl()
	 , prog(make_prog(example))
	 , projection_matrix(prog, "ProjectionMatrix")
	 , camera_matrix(prog, "CameraMatrix")
	 , model_matrix(prog, "ModelMatrix")
	 , shape(List("Position")("Normal")("TexCoord").Get(), shapes::TwistedTorus(), prog)
	 , tex_side(512)
	 , parent_ready(example.parent_ready)
	{
		example.thread_ready = &thread_ready;

		Uniform<Vec3f>(prog, "LightPos").Set(20.0f, 30.0f, 40.0f);

		Texture::Active(0);
		gl.Bound(Texture::Target::_2D, example.tex)
			.MinFilter(TextureMinFilter::Linear)
			.MagFilter(TextureMagFilter::Linear)
			.WrapS(TextureWrap::Repeat)
			.WrapT(TextureWrap::Repeat)
			.Image2D(
				0,
				PixelDataInternalFormat::RGBA,
				tex_side, tex_side,
				0,
				PixelDataFormat::RGBA,
				PixelDataType::UnsignedByte,
				nullptr
			);

		gl.Bound(Renderbuffer::Target::Renderbuffer, rbo)
 			.Storage(
				PixelDataInternalFormat::DepthComponent,
				tex_side,
				tex_side
			);

		gl.Bound(Framebuffer::Target::Draw, fbo)
			.AttachTexture(FramebufferAttachment::Color, example.tex, 0)
			.AttachRenderbuffer(FramebufferAttachment::Depth, rbo);

		Use();
	}
コード例 #5
0
    void insertModule(int i, QString module)
    {
		_lists.insert(i, List());

		// insert new option
		if(_lists.size() > _ld->levelOptionsCount())
		{
            QVector<BtMiniLevelOption> os;
			for(int ii = 0; ii < _ld->levelOptionsCount(); ++ii)
				os.append(_ld->levelOption(ii));

			os.insert(i, _ld->levelOption(i));

			for(int ii = 0; ii < os.size(); ++ii)
				_ld->setLevelOption(ii, os[ii]);
		}

		setupModule(i, module);
    }
コード例 #6
0
ファイル: DlgEmployee.cpp プロジェクト: tastelife/WX3000
BOOL CDlgEmployee::OnInitDialog()
{
    CDialog::OnInitDialog();

    std::vector<SWXLISTCTROLCOLUMN> vecTitle;
    vecTitle.push_back(SWXLISTCTROLCOLUMN(0,"员工号", LVCFMT_LEFT, 50));
    vecTitle.push_back(SWXLISTCTROLCOLUMN(1,"姓名", LVCFMT_LEFT, 74));
    vecTitle.push_back(SWXLISTCTROLCOLUMN(2,"部门", LVCFMT_LEFT, 100));
    vecTitle.push_back(SWXLISTCTROLCOLUMN(3,"性别", LVCFMT_LEFT, 50));
    vecTitle.push_back(SWXLISTCTROLCOLUMN(4,"生日", LVCFMT_LEFT, 110));
    vecTitle.push_back(SWXLISTCTROLCOLUMN(5,"手机", LVCFMT_LEFT, 80));
    vecTitle.push_back(SWXLISTCTROLCOLUMN(6,"座机", LVCFMT_LEFT, 80));
    vecTitle.push_back(SWXLISTCTROLCOLUMN(7,"职位", LVCFMT_LEFT, 60));
    vecTitle.push_back(SWXLISTCTROLCOLUMN(8,"当前状态", LVCFMT_LEFT, 60));
    CWXListCtrl(&this->m_list).SetColTitle(vecTitle);


    List();

    if(E_START_TYPE_SELECTION==m_eStartType)
    {
        this->GetDlgItem(IDC_BUTTON1)->ShowWindow(0);
        this->GetDlgItem(IDC_BUTTON8)->ShowWindow(0);

        EnabaleOk();
    }
    else
    {
        this->GetDlgItem(IDOK)->ShowWindow(0);

        if(!BNS::Power()->GetEmployeePower(BNS::Login()->GetLoginID()).IsCreatePower())
        {
            this->GetDlgItem(IDC_BUTTON1)->ShowWindow(0);
        }
        if(!BNS::Power()->GetEmployeePower(BNS::Login()->GetLoginID()).IsEditPower())
        {
            this->GetDlgItem(IDC_BUTTON8)->ShowWindow(0);
        }
    }

    return TRUE;  // 除非将焦点设置到控件,否则返回 TRUE
}
コード例 #7
0
ファイル: Directory.cpp プロジェクト: chatgen/pandion
void CDirectory::Clear(BSTR path)
{
	VARIANT vList;
	List(path, 0, &vList);

	long upperBound;
	::SafeArrayGetUBound(vList.parray, 1, &upperBound);

	for(long i = 0; i < upperBound; i++)
	{
		VARIANT vListEntry;
		::SafeArrayGetElement(vList.parray, &i, &vListEntry);

		IListEntry* listEntry;
		vListEntry.pdispVal->QueryInterface(__uuidof(listEntry),
			(LPVOID*) &listEntry);

		BSTR name;
		listEntry->get_Name(&name);

		TCHAR newPath[MAX_PATH];
		::StringCchCopy(newPath, MAX_PATH, path);
		::PathAppend(newPath, name);
		::SysFreeString(name);

		BOOL bDir;
		listEntry->get_IsDirectory(&bDir);

		if(bDir)
		{
			Clear(newPath);
		}
		else
		{
			::DeleteFile(newPath);
		}

		listEntry->Release();
	}
	::SafeArrayDestroy(vList.parray);
	::RemoveDirectory(path);
}
コード例 #8
0
void Application::run()
{
	if (!MMEnu)
	{
		cout << "Pas de menu accocher à l'application en cours! " << endl;
		return;
	}

	this->Again = true;


	do
	{
		this->MMEnu->display(cout);

		switch (this->MMEnu->askChoice(cout))
		{

		case eCREATE:		Create();	break;
		case eREAD:			Read();		break;
		case eUPDATE:		Update();	break;
		case eDELETE:		Delete();	break;
		case eDELETEALL:	DeleteAll(); break;
		case eLIST:			List();		break;
		case eFIRST:		First();	break;
		case eNEXT:			Next();		break;
		case eLAST:			Last();		break;
		case ePREVIOUS:		Previous();	break;
		case eSORT:			Sort();		break;
		case eSEARCH:		Shearch();	break;
		case eERROR:		Error();	break;
		case eQUIT:			Quit();		break;
		default:			Bydefault(); break;

		}


	} while (this->Again);


}
コード例 #9
0
ファイル: CSpaceObjectList.cpp プロジェクト: bmer/Mammoth
void CSpaceObjectList::NotifyOnObjEnteredGate (CSpaceObject *pGatingObj, CTopologyNode *pDestNode, const CString &sDestEntryPoint, CSpaceObject *pStargate)

//	NotifyOnObjEnteredGate
//
//	Notify all objects in the list that the given object has entered a stargate.

	{
	int i;

	if (GetCount() > 0)
		{
		TArray<CSpaceObject *> List(m_List);

		for (i = 0; i < List.GetCount(); i++)
			{
			CSpaceObject *pObj = List[i];
			if (!pObj->IsDestroyed())
				pObj->FireOnObjEnteredGate(pGatingObj, pDestNode, sDestEntryPoint, pStargate);
			}
		}
	}
コード例 #10
0
ファイル: CSpaceObjectList.cpp プロジェクト: bmer/Mammoth
void CSpaceObjectList::NotifyOnObjReconned (CSpaceObject *pReconnedObj)

//	NotifyOnObjReconned
//
//	Notify that an object was reconned

	{
	int i;

	if (GetCount() > 0)
		{
		TArray<CSpaceObject *> List(m_List);

		for (i = 0; i < List.GetCount(); i++)
			{
			CSpaceObject *pObj = List[i];
			if (!pObj->IsDestroyed())
				pObj->FireOnObjReconned(pReconnedObj);
			}
		}
	}
コード例 #11
0
BOOL CPop3Connection::GetMessageSize(int nMsg, DWORD& dwSize)
{
	BOOL bSuccess = TRUE;

	//if we haven't executed the LIST command then do it now
	if (!m_bListRetrieved)
		bSuccess = List();

	//nMsg must be in the correct range
	if(nMsg <= 0 || nMsg > m_msgSizes.GetSize())
	{
		//m_sLastCommandResponse = _T("ÎÞЧÓʼþ");//<%IDS_Pop3_12%>
		m_sLastCommandResponse = ::FuncGetStringFromIDS("<%IDS_Pop3_12%>");
		return FALSE;
	}
	
	//retrieve the size from the message size array
	dwSize = m_msgSizes.GetAt(nMsg - 1);
	
	return bSuccess;
}
コード例 #12
0
ファイル: CSpaceObjectList.cpp プロジェクト: bmer/Mammoth
void CSpaceObjectList::NotifyOnPlayerBlacklisted (CSpaceObject *pBlacklistingObj)

//	NotifyOnPlayerBlacklisted
//
//	Notify all objects that the player was blacklisted

	{
	int i;

	if (GetCount() > 0)
		{
		TArray<CSpaceObject *> List(m_List);

		for (i = 0; i < List.GetCount(); i++)
			{
			CSpaceObject *pObj = List[i];
			if (!pObj->IsDestroyed())
				pObj->FireOnObjBlacklistedPlayer(pBlacklistingObj);
			}
		}
	}
コード例 #13
0
ファイル: 025_subroutines.cpp プロジェクト: Extrunder/oglplus
	CubeExample(void)
	 : cube(
		List("Position")("Normal")("TexCoord").Get(),
		shapes::Cube(),
		cube_prog
	)
	{
		// setup the texture
		{
			GLuint tex_side = 512;
			auto image = images::NewtonFractal(
				tex_side, tex_side,
				Vec3f(0.2f, 0.1f, 0.4f),
				Vec3f(0.8f, 0.8f, 1.0f),
				Vec2f(-1.0f, -1.0f),
				Vec2f( 1.0f,  1.0f),
				images::NewtonFractal::X4Minus1(),
				images::NewtonFractal::DefaultMixer()
			);

			gl.Bound(Texture::Target::_2D, cube_tex)
				.Image2D(image)
				.GenerateMipmap()
				.BorderColor(Vec4f(0.8f, 0.8f, 1.0f, 1.0f))
				.MinFilter(TextureMinFilter::LinearMipmapLinear)
				.MagFilter(TextureMagFilter::Linear)
				.WrapS(TextureWrap::Repeat)
				.WrapT(TextureWrap::Repeat);
		}

		cube_prog.cube_tex = 0;
		cube_prog.light_position.Set(4.0f, 4.0f, -8.0f);

		gl.ClearColor(0.8f, 0.8f, 0.7f, 0.0f);
		gl.ClearDepth(1.0f);
		gl.Enable(Capability::DepthTest);
		gl.Enable(Capability::CullFace);
		gl.CullFace(Face::Back);
	}
コード例 #14
0
ファイル: Inventory.cpp プロジェクト: Almamu/evemu_incursion
CRowSet* Inventory::List( EVEItemFlags _flag, uint32 forOwner ) const
{
	DBRowDescriptor* header = new DBRowDescriptor;
	header->AddColumn( "itemID",     DBTYPE_I4 );
	header->AddColumn( "typeID",     DBTYPE_I2 );
	header->AddColumn( "ownerID",    DBTYPE_I4 );
	header->AddColumn( "locationID", DBTYPE_I4 );
	header->AddColumn( "flagID",     DBTYPE_I2 );
	header->AddColumn( "singleton",  DBTYPE_BOOL );
	header->AddColumn( "quantity",   DBTYPE_I4 );
	header->AddColumn( "groupID",    DBTYPE_I2 );
	header->AddColumn( "categoryID", DBTYPE_UI1 );
	header->AddColumn( "customInfo", DBTYPE_STR );
	header->AddColumn( "stacksize" , DBTYPE_I4 );




    CRowSet* rowset = new CRowSet( &header );
    List( rowset, _flag, forOwner );
    return rowset;
}
コード例 #15
0
SEXP aRTconn::Summary()
{
	SEXP info, element, names;

	info = allocVector(VECSXP, aRTconnSSum); // List containing the connection attributes
	names = allocVector(STRSXP, aRTconnSSum); // Names Vector

    STRING_LIST_ITEM(info, names, aRTconnSClass,     "class",    Class());
    STRING_LIST_ITEM(info, names, aRTconnSUser,      "user",     User);
    STRING_LIST_ITEM(info, names, aRTconnSPassword,  "password", Password);
    STRING_LIST_ITEM(info, names, aRTconnSHost,      "host",     Host);

    INTEGER_LIST_ITEM(info, names, aRTconnSPort,     "port",     Port);

    SET_STRING_ELT(names, aRTconnSDatabases, mkChar("databases"));
    element = List();
    SET_VECTOR_ELT(info, aRTconnSDatabases, element);

	setAttrib(info, R_NamesSymbol, names); // Set the names of the list
	
	return info;		 
}
コード例 #16
0
ファイル: object_accessor.hpp プロジェクト: Macostik/Swifty
ValueType Object::get_property_value_impl(ContextType& ctx, const Property &property)
{
    verify_attached();

    size_t column = property.table_column;
    if (is_nullable(property.type) && m_row.is_null(column)) {
        return ctx.null_value();
    }

    if (is_array(property.type) && property.type != PropertyType::LinkingObjects) {
        REALM_ASSERT(property.type == PropertyType::Object);
        return ctx.box(List(m_realm, m_row.get_linklist(column)));
    }

    switch (property.type & ~PropertyType::Flags) {
        case PropertyType::Bool:   return ctx.box(m_row.get_bool(column));
        case PropertyType::Int:    return ctx.box(m_row.get_int(column));
        case PropertyType::Float:  return ctx.box(m_row.get_float(column));
        case PropertyType::Double: return ctx.box(m_row.get_double(column));
        case PropertyType::String: return ctx.box(m_row.get_string(column));
        case PropertyType::Data:   return ctx.box(m_row.get_binary(column));
        case PropertyType::Date:   return ctx.box(m_row.get_timestamp(column));
        case PropertyType::Any:    return ctx.box(m_row.get_mixed(column));
        case PropertyType::Object: {
            auto linkObjectSchema = m_realm->schema().find(property.object_type);
            TableRef table = ObjectStore::table_for_object_type(m_realm->read_group(), property.object_type);
            return ctx.box(Object(m_realm, *linkObjectSchema, table->get(m_row.get_link(column))));
        }
        case PropertyType::LinkingObjects: {
            auto target_object_schema = m_realm->schema().find(property.object_type);
            auto link_property = target_object_schema->property_for_name(property.link_origin_property_name);
            TableRef table = ObjectStore::table_for_object_type(m_realm->read_group(), target_object_schema->name);
            auto tv = m_row.get_table()->get_backlink_view(m_row.get_index(), table.get(), link_property->table_column);
            return ctx.box(Results(m_realm, std::move(tv)));
        }
        default: REALM_UNREACHABLE();
    }
}
コード例 #17
0
ファイル: c.c プロジェクト: TheSShine/321123
 main() 
 { 
    int a; 
    while(1)
    {
        List(); 
        printf("\t请选择:"); 
        while(scanf("%d",&a)!=1||a<0||a>7)
        { 
             printf("\t输入错误!\n\t重新选择:"); 
             getchar(); 
        } 
       
         switch(a){
         case 1: 
            fuli1(); 
             break; 
         case 2: 
            fuli2(); 
             break; 
         case 3: 
             danli(); 
             break; 
         case 4:
            benjin();
             break;
         case 5:
             shijian();
             break;
         case 6:
             benxi();
             break;
         case 7:
             benxi();
             break;
        }
    }
 } 
コード例 #18
0
void Application::Controller(enum_Menu menu)
{
	switch (menu)
	{

	case eCREATE:		Create();	break;
	case eREAD:			Read();		break;
	case eUPDATE:		Update();	break;
	case eDELETE:		Delete();	break;
	case eDELETEALL:	DeleteAll(); break;
	case eLIST:			List();		break;
	case eFIRST:		First();	break;
	case eNEXT:			Next();		break;
	case eLAST:			Last();		break;
	case ePREVIOUS:		Previous();	break;
	case eSORT:			Sort();		break;
	case eSEARCH:		Shearch();	break;
	case eERROR:		Error();	break;
	case eQUIT:			Quit();		break;
	default:			Bydefault(); break;

	}
}
コード例 #19
0
ファイル: 030_pin_display.cpp プロジェクト: Extrunder/oglplus
	BarDisplay(void)
	 : gl()
	 , side(128)
	 , shadow_size(512)
	 , cube(
		List("Position")("Normal").Get(),
		shapes::Cube(0.95, 1.0, 0.95, 0.0, 0.5, 0.0)
	), display_vao(cube.VAOForProgram(display_prog))
	 , shadow_vao(cube.VAOForProgram(shadow_prog))
	{
		init_shadows();
		init_heights();
		init_offsets();

		auto light_proj = CamMatrixf::PerspectiveX(
			Degrees(74),
			1.0,
			1, 3*side
		);
		display_prog.light_proj_matrix.Set(light_proj);
		shadow_prog.projection_matrix.Set(light_proj);
		gl.PolygonOffset(4.0, 4.0);
	}
int main (int argc, char **argv)
{
	int i,j,k;
	int fd1=0,fd2=0,fd3=0;
	char buffer[255];
	/*Invalid input message*/
	if (argc != 2) { // If the user doesn't enter the correct number of parameters...
        fprintf(stderr, "usage: %s <hostname>\n", argv[0]); // Print out usage information.
        exit(1); // And exit with an error code.
    	}
    	clnt = clnt_create(argv[1], SSNFSPROG, SSNFSVER, "tcp"); // Create the RPC client.
  	if (clnt == NULL) { // If there was an error creating the client...
        	fprintf(stderr, "getting client handle failed"); // Report an error message.
        	exit(2); // And exit with an error code.
    	}

      	username = getpwuid(geteuid())->pw_name; // Get the user's username.
	
	fd1=Open("File1"); // opens the file
	printf("\n file descriptor we received is : %d",fd1);
	fd2=Open("File2");
	printf("\n file descriptor received is : %d",fd2);
	for (i=0; i<20;i++){
		Write(fd1, "funny contents in file file1", 15);
	}
	
	Close(&fd1);
		
	for (j=0; j< 5;j++){
		Read(fd2, buffer, 10);
	}
	Close(&fd2);
	Delete("File1");
	List();
	exit (0);

}	
コード例 #21
0
ファイル: editor.c プロジェクト: schwxd/linux-kernel
int main(int argc, char *argv[])
{
	Status s = TRUE;
	int i,k;
	for(i=0;i<MAX_LEN;i++) /* 初始化串 */
		InitString(&T[i]);
	while (s) {
		printf("请选择: 1.打开文件(新或旧)  2.显示文件内容\n");
		printf("        3.插入行  4.删除行  5.拷贝行  6.修改行\n");
		printf("        7.查找字符串        8.替换字符串\n");
		printf("        9.存盘退出          0.放弃编辑\n");
		scanf("%d",&k);
		switch (k)
		{
		case 1: Open();
			break;
		case 2: List();
			break;
		case 3: Insert();
			break;
		case 4: Delete();
			break;
		/* case 5: Copy(); */
		/* 	break; */
		/* case 6: Modify(); */
		/* 	break; */
		/* case 7: Search(); */
		/* 	break; */
		/* case 8: Replace1(); */
		/* 	break; */
		case 9: Save();
		case 0: s=FALSE;
		}
	}

	return 0;
}
コード例 #22
0
Expr cross(const Expr& a, const Expr& b)
{
  TEST_FOR_EXCEPTION(a.size() != b.size(), RuntimeError,
    "mismatched vector sizes in cross(a,b): a.size()=" << a.size()
    << ", b.size()=" << b.size());

  TEST_FOR_EXCEPTION(a.size() < 2 || a.size() > 3, RuntimeError,
    "cross(a,b) undefined for dim=" << a.size());

  if (a.size()==2)
  {
    return a[0]*b[1] - a[1]*b[0];
  }
  else
  {
    return List(
      cross(List(a[1],a[2]), List(b[1],b[2])),
      -cross(List(a[0],a[2]), List(b[0],b[2])),
      cross(List(a[0],a[1]), List(b[0],b[1]))
      );
  }
}
コード例 #23
0
ファイル: command.cpp プロジェクト: AlexMooney/ivan
truth commandsystem::ShowKeyLayout(character*)
{
  felist List(CONST_S("Keyboard Layout"));
  List.AddDescription(CONST_S(""));
  List.AddDescription(CONST_S("Key       Description"));
  festring Buffer;

  for(int c = 1; GetCommand(c); ++c)
    if(!GetCommand(c)->IsWizardModeFunction())
    {
      Buffer.Empty();
      Buffer << GetCommand(c)->GetKey();
      Buffer.Resize(10);
      List.AddEntry(Buffer + GetCommand(c)->GetDescription(), LIGHT_GRAY);
    }

  if(game::WizardModeIsActive())
  {
    List.AddEntry(CONST_S(""), WHITE);
    List.AddEntry(CONST_S("Wizard mode functions:"), WHITE);
    List.AddEntry(CONST_S(""), WHITE);

    for(int c = 1; GetCommand(c); ++c)
      if(GetCommand(c)->IsWizardModeFunction())
      {
        Buffer.Empty();
        Buffer << GetCommand(c)->GetKey();
        Buffer.Resize(10);
        List.AddEntry(Buffer + GetCommand(c)->GetDescription(), LIGHT_GRAY);
      }
  }

  game::SetStandardListAttributes(List);
  List.Draw();
  return false;
}
コード例 #24
0
ファイル: CSpaceObjectList.cpp プロジェクト: bmer/Mammoth
void CSpaceObjectList::NotifyOnObjDestroyed (SDestroyCtx &Ctx)

//	NotifyOnObjDestroyed
//
//	Notify all objects in the list that another object was destroyed.

	{
	int i;

	if (GetCount() > 0)
		{
		//	We make a copy of our list because an event might remove an object
		//	from our list.

 		TArray<CSpaceObject *> List(m_List);

		for (i = 0; i < List.GetCount(); i++)
			{
			CSpaceObject *pObj = List[i];
			if (!pObj->IsDestroyed())
				pObj->OnObjDestroyedNotify(Ctx);
			}
		}
	}
コード例 #25
0
ファイル: Inventory.cpp プロジェクト: Almamu/evemu_server
CRowSet* Inventory::List( EVEItemFlags _flag, uint32 forOwner ) const
{
    PyList *keywords = new PyList();
    keywords->AddItem(new_tuple(new PyString("stacksize"), new PyToken("util.StackSize")));
    keywords->AddItem(new_tuple(new PyString("singleton"), new PyToken("util.Singleton")));

    DBRowDescriptor* header = new DBRowDescriptor(keywords);
    header->AddColumn( "itemID",     DBTYPE_I8 );
    header->AddColumn( "typeID",     DBTYPE_I4 );
    header->AddColumn( "ownerID",    DBTYPE_I4 );
    header->AddColumn( "locationID", DBTYPE_I8 );
    header->AddColumn( "flagID",     DBTYPE_I2 );
    header->AddColumn( "quantity",   DBTYPE_I4 );
    header->AddColumn( "groupID",    DBTYPE_I2 );
    header->AddColumn( "categoryID", DBTYPE_I4 );
    header->AddColumn( "customInfo", DBTYPE_STR );

    //header->AddColumn( "singleton",  DBTYPE_BOOL );
    //header->AddColumn( "stacksize" , DBTYPE_I4 );

    CRowSet* rowset = new CRowSet( &header );
    List( rowset, _flag, forOwner );
    return rowset;
}
コード例 #26
0
ファイル: timer.c プロジェクト: Syntroth/redpill_mush
/** Migrate some number of chunks.
 * The requested amount is only a guideline; the actual amount
 * migrated will be more or less due to always migrating all the
 * attributes, locks, and mail on any given object together.
 * \param amount the suggested number of attributes to migrate.
 */
static void
migrate_stuff(int amount)
{
  static int start_obj = 0;
  static chunk_reference_t **refs = NULL;
  static int refs_size = 0;
  int end_obj;
  int actual;
  ATTR *aptr;
  lock_list *lptr;
  MAIL *mp;

  if (db_top == 0)
    return;

  end_obj = start_obj;
  actual = 0;
  do {
    for (aptr = List(end_obj); aptr; aptr = AL_NEXT(aptr))
      if (aptr->data != NULL_CHUNK_REFERENCE)
        actual++;
    for (lptr = Locks(end_obj); lptr; lptr = L_NEXT(lptr))
      if (L_KEY(lptr) != NULL_CHUNK_REFERENCE)
        actual++;
    if (IsPlayer(end_obj)) {
      for (mp = find_exact_starting_point(end_obj); mp; mp = mp->next)
        if (mp->msgid != NULL_CHUNK_REFERENCE)
          actual++;
    }
    end_obj = (end_obj + 1) % db_top;
  } while (actual < amount && end_obj != start_obj);

  if (actual == 0)
    return;

  if (!refs || actual > refs_size) {
    if (refs)
      mush_free(refs, "migration reference array");
    refs =
      mush_calloc(actual, sizeof(chunk_reference_t *),
                  "migration reference array");
    refs_size = actual;
    if (!refs)
      mush_panic("Could not allocate migration reference array");
  }
#ifdef DEBUG_MIGRATE
  do_rawlog(LT_TRACE, "Migrate asked %d, actual objects #%d to #%d for %d",
            amount, start_obj, (end_obj + db_top - 1) % db_top, actual);
#endif

  actual = 0;
  do {
    for (aptr = List(start_obj); aptr; aptr = AL_NEXT(aptr))
      if (aptr->data != NULL_CHUNK_REFERENCE) {
        refs[actual] = &(aptr->data);
        actual++;
      }
    for (lptr = Locks(start_obj); lptr; lptr = L_NEXT(lptr))
      if (L_KEY(lptr) != NULL_CHUNK_REFERENCE) {
        refs[actual] = &(lptr->key);
        actual++;
      }
    if (IsPlayer(start_obj)) {
      for (mp = find_exact_starting_point(start_obj); mp; mp = mp->next)
        if (mp->msgid != NULL_CHUNK_REFERENCE) {
          refs[actual] = &(mp->msgid);
          actual++;
        }
    }
    start_obj = (start_obj + 1) % db_top;
  } while (start_obj != end_obj);

  chunk_migration(actual, refs);
}
コード例 #27
0
ファイル: list.hpp プロジェクト: dune73/ironbee
 /**
  * Create new list.
  *
  * Creates a new empty list using @a memory_pool for memory.
  *
  * @param[in] memory_pool Memory pool to use.
  * @return Empty List.
  **/
 static List create(MemoryPool memory_pool)
 {
     ib_list_t* ib_list;
     Internal::throw_if_error(ib_list_create(&ib_list, memory_pool.ib()));
     return List(ib_list);
 }
コード例 #28
0
ファイル: list.hpp プロジェクト: dune73/ironbee
 /**
  * Remove the constness of a ConstList
  *
  * @warning This is as dangerous as a @c const_cast, use carefully.
  *
  * @param[in] list ConstList to remove const from.
  * @returns List pointing to same underlying list as @a list.
  **/
 static List remove_const(ConstList<T> list)
 {
     return List(const_cast<ib_type>(list.ib()));
 }
コード例 #29
0
ファイル: plugin.cpp プロジェクト: nobyt/openbabel
string OBPlugin::ListAsString(const char* PluginID, const char* param)
{
    stringstream ss;
    List(PluginID, param, &ss);
    return ss.str();
}
コード例 #30
0
ファイル: List.cpp プロジェクト: Mmonya/Monya_folder
List List::operator+(const List& rhs)
{
	return List(*this) += rhs;
}