访问共享内存C ++ POSIX中的数据(Access data in shared memory C++ POSIX)
我打开一块共享内存并掌握它。 我知道存储器中存储了几个数据向量。 我想访问这些数据向量并对它们执行一些操作。 我怎样才能做到这一点? 将共享内存视为对象是否合适,以便我们可以将这些向量定义为对象的字段,将那些需要的操作定义为对象的成员函数?
我以前从未处理过共享内存。 更糟糕的是,我是C ++和POSIX的新手。 有人可以提供一些指导吗? 非常感谢简单的例子。
I open a piece of shared memory and get a handle of it. I'm aware there are several vectors of data stored in the memory. I'd like to access those vectors of data and perform some actions on them. How can I achieve this? Is it appropriate to treat the shared memory as an object so that we can define those vectors as fields of the object and those needed actions as member functions of the object?
I've never dealt with shared memory before. To make things worse, I'm new to C++ and POSIX. Could someone please provide some guidance? Simple examples would be greatly appreciated.
原文:https://stackoverflow.com/questions/8154425
最满意答案
您可以尝试通过数据处理器使用验证。 以下是文档中的教程: http : //docs.dhtmlx.com/doku.php? id = ddtmlxdataprocessor : configuring_debugging #validation
Well I have found something. the problem was when i was going to use validation in multiple columns.
myGrid.setColValidators("NotEmpty,NotEmpty,,");
But is_invalid status of a row was undefined if i don't set the status of the row to true on an event
myGrid.attachEvent("onValidationError", function (id, ind, value) { dpmygrid.set_invalid(id,true) }
But when i correct one validation it automatically update the Is_Invalid status of row to false even there are still some other errors in the same row. So later on i used 'setUserData' to update the status of the grid row.
myGrid.attachEvent("onValidationError", function (id, ind, value) { myGrid.setUserData(id, ind, "error"); } myGrid.attachEvent("onValidationCorrect", function (id, ind, value) { myGrid.setUserData(id, ind, null); }
and before sumbit we can check the setUserData status of the row.
相关问答
更多-
我发现了波纹管解决方案。它工作正常。 myGrid.entBox.onselectstart = function(){return true; }; I have found the bellow solution.It's working fine. myGrid.entBox.onselectstart = function(){ return true; };
-
你需要删除“myDP.enableDataNames(true);” 线 此命令可与自定义后端一起使用,但在服务器端使用连接器时,必须使用默认数据发送模式。 I updated the connector.js and some other things, also messed with the names for the cells a bit and now it works. You can view the diff on the github page for details. Also, I ...
-
达到所需功能的最佳方法是创建自定义排序功能,该功能仅按值的第二部分对列进行排序。 在这里你可以找到一个教程: https://docs.dhtmlx.com/grid__sorting.html#customsortingfunction 一个简单的工作示例: http://snippet.dhtmlx.com/146a327f0 The best way for you to reach the required functionality is to create a custom sorting fu ...
-
如果选中复选框,则更改单元格值 - RoR中的dhtmlxGrid(Change cell value if checkbox selected - dhtmlxGrid in RoR)[2022-11-18]
您已经拥有要更新的rowId,因此您只需告诉网格设置所需列的值,并将该行标记为已更新以供数据处理器检测更改 function doOnCheckBoxSelected(rID, cInd, state){ if (state=='1'){ alert("date approved"); } var currentDate = new Date(); //This is just an example, here you can generate the Date in ... -
在dhtmlxGrid中组合(Combo in dhtmlxGrid)[2022-06-16]
不幸的是,这个问题无法在当地复制。 您的代码适合我们。 如果问题仍然存在,请在http://support.dhtmlx.com/上打开一张票,并提供完整的演示或演示链接,以便重建问题。 Unfortunately, the issue cannot be reproduced locally. Your code works well for us. If the issue still occurs for you, please, open a ticket at http://support.dht ... -
如何检查使用数据处理器的DhtmlxGrid中是否有任何错误?(How to check is there any error in DhtmlxGrid using Dataprocessor?)[2023-09-17]
您可以尝试通过数据处理器使用验证。 以下是文档中的教程: http : //docs.dhtmlx.com/doku.php? id = ddtmlxdataprocessor : configuring_debugging #validation Well I have found something. the problem was when i was going to use validation in multiple columns. myGrid.setColValidators("NotEm ... -
我知道这是一个老帖子,只是想说使用dhtmlx数据存储区是一个很好的方法。 对数据存储区所做的任何更改都会自动推送到网格。 还有各种各样的事件处理程序可以添加到数据存储区和网格中。 还有用于更改数据存储区的API。 Dhtmlx非常棒。 我已经使用dhtmlx超过一年了,我发现有一些方法可以满足我所需要的一切。 I know this is an old post, just wanted to say that using the dhtmlx datastore is a good approach. ...
-
请尝试使用以下解决方案: myGrid.attachEvent("onEditCell", doOnEdit); ... function doOnEdit(stage,rId,cInd,nValue,oValue){ if (cInd==0 && nValue=="100") return false return true } Please, try to use the following solution: myGrid.attachEvent("onEditCell", doO ...
-
将应用程序部署到heroku后不再出现此错误。 在我看来,这只是webrick的一个问题。 This error does not occur anymore after deploying the app to heroku. It seems to me, that this is just a problem of webrick.
-
在这里你可以找到JSON数据可用的格式,可以加载到网格中的文章: http://docs.dhtmlx.com/grid__data_formats.html#jsonformat Here you can find an article with the available formats of json data that can be loaded to the grid: http://docs.dhtmlx.com/grid__data_formats.html#jsonformat