This class shall successively replace the current DocId(quint64) to gain more flexibility.
- Account for 64bit inodes
- Port away from stBuf.st_dev which is not always constant
- Use document ids of variable size
adridg |
Baloo | |
Frameworks |
This class shall successively replace the current DocId(quint64) to gain more flexibility.
make test
No Linters Available |
No Unit Test Coverage |
A quick review of some quirks and weirdnesses in c++
src/engine/documentid.cpp | ||
---|---|---|
67 ↗ | (On Diff #28005) | if you make operator DeviceIdAndInode explicit, you probably end up with a bit better behavior. Else the compiler happily converts a documentid to a deviceidandinode in order to make various comparisons at compile time. e.g. DocumentId id(5,5); |
src/engine/documentid.h | ||
34 ↗ | (On Diff #28005) | Does it need to be exported? Is things outside of the baloo engine need to access this? (or is it just avaliable for tests) If it is public-public, you need to be careful about the class size and ensure you have enough bits to work with in the members. |
41 ↗ | (On Diff #28005) | is this needed? or is the default generated good enough? |
45 ↗ | (On Diff #28005) | shouldn't this return a DocumentId& rather than a copy? |
46 ↗ | (On Diff #28005) | =default or if you remove the custom dtor, this will be autogenerated. |
I have made two errors:
src/engine/documentid.h | ||
---|---|---|
51–52 | Make a d poniter in exported class. |
src/engine/documentid.h | ||
---|---|---|
51–52 | it depends on why it is exported. If it is exported just for unit test (and the header file not installed), then we don't need to have the mental and code wise overhead of a d-pointer. If we know that it will never ever need to grow, we also don't need the overhead of a d-pointer. |
src/engine/documentid.cpp | ||
---|---|---|
67 ↗ | (On Diff #28005) | This is intended. At the moment the class should behave like quint64(=DeviceIdAndInode) |
src/engine/documentid.h | ||
51–52 | I have to admit, I have not understood the meaning of BALOO_ENGINE_EXPORT yet. The file which defines it looks like it's automatically created. I inserted it after trial and error. Except for testing I see no reason why it should be exported. I consider it as strictly internal. In its present state this class shall serve as a replacement for the quint64 that baloo is currently using for an id. This class is used a lot. What I have read about d-pointers so far indicates a huge performance hit when using indirection. Maybe I'm wrong. @svuorela: I'm sorry if my answer appeared uncouth. That was not intended. Currently a lot of my programming is the result of trial and error rather than knowledge. In time the ratio, hopefully, will change in favor of the latter :) |
This looks abandoned with 2 years of no movement. @michaelh do you still feel this is a WIP?