is there a good way to find function define in header file in ace framework - ace

As a ace framework newer, i always encounter some problem when using this framework.
I copy some example code from website and execute it in linux. however some error throw out because of no include correspond header file. for exmaple some error like this: error: ‘sleep’ is not a member of ‘ACE_OS’.
so how can i found this function define in which header file

Most easiest is just to do a "grep sleep $ACE_ROOT/ace/OS*.h", that tells you the file where this method is defined. Other option is to use the most recent doxygen tree at http://doxygen.theaceorb.nl/libace-doc/index.html

Related

Objectbox configuration for Swift Package

I would like to use objectbox inside a swift package, not inside a project, but on the documentation I couldn't find a procedure to follow to complete the operation.
I found no problem adding the library as a dependency:
.package(url: "https://github.com/objectbox/objectbox-swift", from: "1.8.0")
My problem is finding the correct strategy to use the code generator.
The documentation and scripts in the package say to call Sourcery like this:
"$sourcery" --xcode-project "${PROJECT_FILE_PATH}" --xcode-target "${TARGETNAME}" $MODULENAME1 $MODULENAME2 $#
In my case, the entities are present in my Package, so inside a directory, it would be correct if I use the Sourcery based ObjectBox code generator indicating the path "source" and the "output" instead of the project "--xcode-project " and of the "target"?
If this is not the correct way to go, do you have alternative ideas?

Add 'library' directive to dart code generated using protoc

Can someone tell me how to get protoc to generate dart files with a leading library directive?
I'm using the dart-protoc-plugin (v0.10.2) to generate my dart, c++, c#, js and java models from proto files. I was under the impression there was no way to get protoc to add a 'library' directive to the generated dart files, until I noticed the directive appearing in another project (see date.pb.dart).
If I take the same file (date.proto) I cannot get protoc to generate a dart file containing a 'library' directive.
In short: I want to take a .proto file with the following content
syntax = "proto3";
package another.proj.nspace;
message MyObj {
...
}
and produce a .dart file with a leading 'library' directive similar to the following snippet
///
// Generated code. Do not modify.
///
// ignore_for_file: non_constant_identifier_names,library_prefixes
library another.proj.nspace;
...
NOTE: I don't care about the actual value of the directive since I can restructure my code to get the desired result. I just need a way for protoc to add the library directive...
The basic command I'm using to generate the dart files is
protoc --proto_path=./ --dart_out="./" ./another/proj/nspace/date.proto
Unfortunately the dart-protoc-plugin's README isn't very helpful and I had to go through the source to find out which options are available; and currently it seems like the only dart-specific option is related to grpc.
I've tried options from the other languages (e.g. 'library', and 'basepath') without any success.
It would simplify my workflow quite a bit if this is possible, but I'm starting to get the impression that the library directive in date.pb.dart is added after the code was generated...
After asking around a little bit, it seems that the library directive was removed from the protoc plugin at some stage (see pull request), thus it is no longer supported.

Generating a Vapi file for a Vala library

I've got a library written in Vala that has always worked fine generating a .vapi file for itself, I think because it's a free operation with valac but I'm not positive on that. I went and tried to use VAPIGEN_CHECK in my configure.ac file and the associated VAPIGEN_MAKEFILE in my Makefile.am and now I get:
error: The type name `GLib.TypeInstance' could not be found
My corresponding .gir file contains:
<field name="parent_instance">
<type name="GObject.TypeInstance" c:type="GTypeInstance"/>
</field>
So the error seems to make sense because I can't find the GObject.TypeInstance class/struct in any .vapi file, but GTypeInstance is in one of the GLib headers.
Should I even be doing it this way if I'm writing everything in Vala already? Is there a possibility that this is missing from the Vapi?
Edit: Possibly just due to my not deriving GLib.Object which I thought was implicit. Still trying to fix something else that prevents this but once that's done I will update this to say whether or not it actually matters.
To generate a VAPI file from a Vala program you should simply use the --vapi option with valac, e.g.:
valac --vapi my_library_name.vapi my_library.vala
From what you are describing I think you are generating a GIR (GObject Introspection Repository) file with valac, then using vapigen to create the VAPI file. vapigen is part of Vala and maintained in the Vala source code, but it is a tool for generating a VAPI file to bind to non-Vala projects. If the non-Vala project distributes a GIR file it makes the binding very easy.
When using vapigen you need to give the packages it uses, so you need to check you are including the right pkg-config flags, e.g.:
vapigen --pkg glib-2.0 --pkg gobject-2.0 my_library.gir
The other possibility is there is no binding for GTypeInstance in Vala. I've had a quick look and I'm not finding anything.

Using signature file in script

I like using .fsi signature files to control visibility. However, if I have both Foo.fsi and Foo.fs files in my solution, and #load "Foo.fs" in a script, it doesn't seem like the corresponding signature file gets used. If I do:
#load "Foo.fsi"
#load "Foo.fs"
... then the desired visibility control happens. Is this the recommended way to achieve this, or is there a better way to do it? In a perfect world, one would like to see the signature file automatically loaded, too.
Not a final answer, but a better way.
From reading Expert F# 4.0 one can do
#load "Foo.fsi" "Foo.fs" "Foo.fsx"
All three loads are on one line.
TL;DR
The link to the book is via WolrdCat just put in a zip code and it will show you locations near there where the book can be found.

Embed the sample files of F# JsonProvider to use in a library

According to this, you can specify samples as embedded resources by using EmbeddedResource:
type Declaracion = JsonProvider<"declaracion.json", EmbeddedResource="Irpf.Hechos, declaracion.json">
But when I reference this library, "Irpf.Hechos.dll", I get a File Not Found error, the path ConsumingLibraryPath\declaracion.json is not found; typecheck error FS3033
I have tried to set the declaracion.json file as resource, and content, but no luck.
Am I missing some step?
You need to set the build action as "EmbeddedResource" rather than "Resource".

Resources