We have a tool that generates a class in a header file that is generated with hard-coded arrays. This autogenerated is inherited by a real implementation that uses auto-generated values.
Auto-generated example:
class MyTestAutoGen
{
std::vector<int> m_my_parameter1;
std::vector<int> m_my_parameter2;
...
public:
MyTestAutoGen()
{
SetDefaultValueFor_my_parameter1();
SetDefaultValueFor_my_parameter2();
...
}
void SetDefaultValueFor_my_parameter1()
{
int tmp[] = {121,221,333,411,225,556,227,.......};
m_my_parameter1.assign(tmp, tmp + 65025);
}
void SetDefaultValueFor_my_parameter2()
{
int tmp[] = {333,444,333,987,327,16728,227,.......};
m_my_parameter2.assign(tmp, tmp + 65025);
}
...
};
Compilation takes a lot of time, and in the VS output windows I see that it hangs in the "Generating Code" phase of compilation, but it will complete compilation in about 15-30 minutes if the compiler does not work with a stack overflow.
"Multiprocessing Compilation" "Parallel Code Generation", . " " , .
, , , , , TEXT STATIC / . , ( ):
class MyTestAutoGen
{
std::vector<int> m_my_parameter1;
std::vector<int> m_my_parameter2;
...
public:
MyTestAutoGen()
{
SetDefaultValueFor_my_parameter1();
SetDefaultValueFor_my_parameter2();
...
}
void SetDefaultValueFor_my_parameter1()
{
std::string codedDefaultValue = "\x079\0\0\0.......";
std::stringstream str(codedDefaultValue);
int tmp;
for (int i = 0; i < codedDefaultValue.length() / sizeof(int); i++)
{
str.read((char*) &tmp, sizeof(int));
m_my_parameter1.push_back(tmp);
}
}
void SetDefaultValueFor_my_parameter2()
{
std::string codedDefaultValue = "\x04d\x001.......";
std::stringstream str(codedDefaultValue);
int tmp;
for (int i = 0; i < codedDefaultValue.length() / sizeof(int); i++)
{
str.read((char*) &tmp, sizeof(int));
m_my_parameter2.push_back(tmp);
}
}
...
};
, ( ).
, -, ?